I am trying to make a simple POST from javascript (google chrome extension) to my google application I can see that the HTTP POST is indeed sent to the GAE server, but I cannot figure out how to pass a simple text string and use it in a Google application.
Purpose: send a string from javascript using xmlhttpRequest, show this string on google-app web page.
Here is the javascript code:
function onRequest(request, sender, sendResponse) { var url = request; var xhr = new XMLHttpRequest(); xhr.open("POST", "http://myapp.appspot.com"); xhr.send(url);
Here's how I deal with a server-side message:
def post(self): url1 = str(self.request.get('url1')) self.response.headers['Content-Type'] = 'text/html' self.response.out.write('<p>URL is: %s</p>' % url1)
When I look at the POST response, I see
<p>URL is: </p>
where is the var url being sent?
source share