Hey All,

I've been having some heavy jquery cross-domain issues, so I've been trying
to get around that through web2py.

I'm sending POST data from a local HTML file to my web2py server.  Web2py
is then making a python POST to a second server (which solves the
cross-domain issue) and gets the expected response.  How should I get that
response back to my local html file?

I've thought about storing those results in a database and then retrieving
them with a url redirect-- but I'm not sure that I'd be able to guess what
URL I would need.  Perhaps just grab the last entry from the database.

Or is there a better method?

I realize there are probably much better methods to do this directly from
the original local html file and circumvent web2py completely, but I'm much
more comfortable in python than js.

So I'm trying to get from:

[local html file]->[POST to web2py]->[POST to other separate
server]->[RESPONSE back to local html file]

I just can't get that last leg figured out.

My controller that posts to the 2nd server:

def index():
    response.headers['content-type'] = 'text/xml'
    xml = request.body.read()
    query_args = { 'data': xml }
    encoded_args = urllib.urlencode(query_args)
    url = 'myserver.com'
    content = urllib2.urlopen(url, encoded_args).read()
    return response.render(dict(content=XML(content)))


Thanks ahead of time.

Reply via email to