Hello,
I'm trying to do an XHR call to a BXApp and wanting to use post
variables. Using the web inspector in Safari I can see that a request
was sent, and it did use the POST method with a payload. Here is the
output:
Request URL:
http://10.0.1.110:80/vault/login
Request Method:POST
Status Code:200 OK
Request Headers
Accept:application/json
Cache-Control:max-age=0
Content-Type:application/json; charset=UTF-8
If-Modified-Since:Thu, 01 Jan 1970 00:00:00 GMT
Origin:
http://10.0.1.110
Referer:
http://10.0.1.110:80/
User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us)
AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8
X-Requested-With:XMLHttpRequest
Request Payload
{"username":"test","password":"1234"}
Response Headers
Connection:keep-alive
Content-Type:text/html; charset=utf-8
Date:Wed, 11 Aug 2010 19:38:25 GMT
Server:Bombax 1.0 : nginx/0.8.31
Transfer-Encoding:Identity
I have a handler that gets called, but the POST variables are always
empty. Here is what is in my handler:
- (id)renderWithTransport:(BxTransport *)transport {
if ([transport.requestPath isEqualToString:@"/favicon.ico"]) {
[transport setHttpStatusCode:404];
return self;
}
NSLog(@"Post Variables: %@", [transport.postVars description]);
return self;
}
I have also tried the [transport.rawPostData description] but that
always comes back as null. I'm not sure what I'm doing wrong.