|
i am trying to do a simple post... http://crg.ss-corp.com/live.asp?cid=1012&email=test@ss-corp.com&firstname=steve&lastname=ward&ip=111.111.111.111&url=ss-corp.com.com project currently written in php. would like to use FoxPro to post data from the table and record the results. I still don't understand how the get would work as to where i would place each of the vailiable to be passed...however on the post side i have created the following...it works (meaning runs without error) however no data was posted to the table on the receiving end.
|
|
If you wish to duplicate what the browser sends when you cut-and-paste the entire URL (above), including the params, into the browser's address textbox, then you would send a GET, not a POST. You would call http.QuickGetStr, as shown here: http://www.example-code.com/foxpro/http_get.asp To send a POST, then create an HttpRequest object, add each of the params, and then call PostUrlEncoded, as shown here: http://www.example-code.com/foxpro/http_postUrlEncoded.asp (The URL passed to PostUrlEncoded would be "http://crg.ss-corp.com/live.asp", which is everything up to but not including the "?" from the URL above. The difference between a GET and a POST is shown below: This is the HTTP GET request sent by QuickGetStr:
All HTTP requests are composed of a "start line" followed by a MIME message (i.e. MIME header + body). A GET request has an empty body and the params are provided in the "start line". This is the POST request:
In a POST request, the path to the resource is provided on the "start line", and the params are passed in the body of the MIME. In this case, since the Content-Type is "x-www-form-urlencoded", the body contains the URL encoded params. The Content-Length header indicates the number of bytes in the body. |
|
I still don't understand how the get would work as to where i would place each of the vailiable to be passed...however on the post side i have created the following...it works (meaning runs without error) however no data was posted to the table on the receiving end. z
|
|
There are two ways to verify the POST.
The classic ASP source for echoPost.asp looks like this:
|
|
ok i added the 2 steps when I run it now with the http://www.chilkatsoft.com/echoPost.asp i get the following txt file However when using my url http://crg.ss-corp.com/live.asp i get no log file at all |
|
This shows that the HTTP POST is being sent correctly. The problem is either on the server-side, or maybe the server side is expecting something different, in which case it's impossible for me to know what your server-side app might be expecting.. |