View Single Post
  #1 (permalink)  
Old 09-15-2008, 01:09 PM
ab5602 ab5602 is offline
Project Contributor
 
Posts: 63
Question [SOLVED] Does POST method through proxy work?

I'm trying to get an HTML POST to an external page to work via the built-in Zimlet proxy service, but I've so far have been unable to get the proxy to pass the POST variables through...

GET requests work :
Code:
 
 var request = new AjxRpcRequest("zimlet"); 
 var info_url = "http://test.com?key=value";
 var url = ZmZimletBase.PROXY + AjxStringUtil.urlEncode(info_url);
 request.invoke(null, url, null, new AjxCallback(this, my.callback, div), true);
Inserting headers works :
Code:
 
 var request = new AjxRpcRequest("zimlet"); 
 var reqHeader = {"Content-Type":"application/x-www-form-urlencoded"};
 var info_url = "http://test.com";
 var url = ZmZimletBase.PROXY + AjxStringUtil.urlEncode(info_url);
 request.invoke(null, url, reqHeader, new AjxCallback(this, my.callback, div), true);
But I can't seem to get HTML POSTs working? :
Code:
 
 var request = new AjxRpcRequest("zimlet"); 
 var reqHeader = {"Content-Type":"application/x-www-form-urlencoded"};
 var reqParam = AjxStringUtil.urlEncode("a=b");
 var info_url = "http://test.com";
 var url = ZmZimletBase.PROXY + AjxStringUtil.urlEncode(info_url);
 request.invoke(reqParam, url, reqHeader, new AjxCallback(this, my.callback, div), true);
The POST variables just never show up at the server.. Does anyone know if the Proxy service allows HTTP POSTs or am I doing something wrong here?

Thanks!
-Rob

Last edited by ab5602 : 09-15-2008 at 01:16 PM.
Reply With Quote