I was thinking you would want Web2py to package the remote server's 
response into something the browser could render.

On Wednesday, March 20, 2013 10:08:08 AM UTC-4, Anthony wrote:
>
>
> if session.username and session.password: 
>>    # caveat: I have never done this, but there must by Python libraries 
>> for it
>>    send a GET to the remote server with session.username and 
>> session.password in the header as user credentials
>>    wait for the remote server's response
>>    Web2py processes the response into a view and use it to respond the 
>> the originator
>>
>
> That last part above doesn't necessarily have to be proxied through the 
> Receiver app -- instead, it can just be a direct Ajax request (using CORS 
> or JSONP given that it is a cross-domain request):
>
> var gBaseUrl="http://127.0.0.1:8000/Provider/sites/";;
> $(document).ready(function(){
>   $.ajax({
>       type: "GET",
>       async: true,
>       url: gBaseUrl+"get_username",
>       dataType: "text",
>       username: "{{=session.username}}",
>       password: "{{=session.password}}",
>       success: function(data){
>         $('#ContentView').append('<p> succeeded '+data+'</p>');
>       }
>       failure: function(data){
>         $('#ContentView').append('<p> failed '+data+'</p>');
>       }
>     });
> });
>
> Anthony
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to