[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: HTTP API post xml with HTTP headers
D Add_SOAPACTION PR
D Header 1024A varying
D UserData * value
D SOAP s 32767A varying
/Free
resp = *ALLx'00';
http_debug(*ON);
// This tells HTTPAPI to call our subprocedure (in this example,
// the subprocedure is name ADD_SOAPACTION) when assembling the
// HTTP headers to send to the remote server.
http_xproc( HTTP_POINT_ADDL_HEADER
: %paddr(Add_SOAPACTION) );
// run http_url_post_xml
http_debug(*OFF);
*inlr = *on;
/End-Free
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* HTTPAPI will call this (because we set it with http_xproc)
* just before sending the HTTP headers to the remote server.
* This procedure lets us add any header we like to the
* HTTP request.
*
* In this example, I'll use it to supply the SoapAction:
* header. This way, I can supply a SOAPAction that's up to
* 1024 characters long.
*
* NOTE: Make sure you leave off the SOAPAction header on the
* HTTP_url_post_xml, above, otherwise you'll send two
* of them!
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
P Add_SOAPACTION B
D Add_SOAPACTION PI
D Header 1024A varying
D UserData * value
/free
Header = 'SOAPAction: '
+ 'http://www.webserviceX.NET/GetInfoByZIP'
+ x'0d25';
/end-free
P E
I can't remember if I got this from an example in LIBHTTP or while
looking through the archives.
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
akamadoushi@xxxxxxx
Sent: Wednesday, December 20, 2006 1:48 PM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: HTTP API post xml with HTTP headers
Hi. I was going over the examples with the HTTPAPI and can't seem to
find an example that includes specifying HTTP headers.
I'm working with a vendor that requires I specify certain HTTP headers
in my post.
Can anyone give me an example of how to specify http headers using
http_url_post_xml? For example I need to specify "MIME-Version: 1.0"
and "Content-transfer-encoding: text"
In the meantime I ended up modifying HTTPAPIR4 to add the headers I
need, but I'd really like to keep away from changing the code in
LIBHTTP.
Thanks in advance,
Edgar
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------