Home > Uncategorized > Get To Post Proxy

Get To Post Proxy

I was having problems getting a HTTP POST to work via Ajax while running Phonegap on Android, so in my frustration, I found a workaround. A proxy that converts a HTTP Get Request into a HTTP Post request.

http://get2post.freetextuk.com? – followed by the URL with the data in GET format.

The proxy is quite simple:

var strUrl = Request.ServerVariables[“QUERY_STRING”];
if (string.IsNullOrEmpty(strUrl))
{
Response.Write(“A QueryString is required”);
return;
}
int locQ = strUrl.IndexOf(“?”);
if (locQ == -1)
{
Response.Write(“No data to post?”);
return;
}
var strPostUrl = strUrl.Substring(0, locQ);
var strPostData = strUrl.Substring(locQ+1);

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment