[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "POST"ing urlencoded data
Parameter 7 is the content-type parameter. It's just a note to send to
the server to tell it what you're sending. You can say "I'm sending you
an XML document." Or "I'm sending you a Microsoft Word document" or
Excel, or a JPEG picture, or a WAV sound file, or whatever you happen to
be sending. It's just a note passed from your program to the server to
explain what sort of file you're sending.
If the data in your program happens to be data from a browser's form,
and you've already URL encoded that data, then yes, you should tell it
that you're sending URL encoded form data (using the content type that
you suggested)
However, HTTPAPI will not attempt to convert your data to that format
for you. It has to already be in that format. HTTPAPI does not have
any concept of the data you're sending. All it does is run it through
an ASCII/EBCDIC translation table, and then copy it byte-by-byte to the
server. It does not understand your data, and therefore cannot convert
it for you.
There are some separate routines in HTTPAPI for URL encoding that you
can call independently of http_url_post() if you want some help with URL
encoding it.
EXAMPLE2 demonstrates how to use the URL encoder in conjunction with
HTTP_url_post().
Huesman, Dan wrote:
> If I need to post the data as urlencoded vesus text; is it as simple
> as changing the 7th parm to "'application/x-www-form-urlencoded'" on
> the http_url_post api?
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------