[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Need XMLREQUEST= using http_url_post



POST and GET end up doing the same thing...just slightly differently. The host gets sent (under the covers using a socket connection to an IP address) and the data gets sent with parameter markers. In GET, it is sent "all together"; in POST it is sent as "data". Either way CAN work but the service needs to be expecting it in the same format.

> the httpapi_debug does not show the actual request with the url and the formatted request.
It DOES! Maybe not in the exact format you expect but look again. Here is the section of debug from EXAMPLE1

GET /presentations/Web%20Services%20from%20RPG%20with%20HTTPAPI.pdf HTTP/1.1 
Host: www.scottklement.com                                                   
User-Agent: http-api/1.24                                                    

You can see the transaction is a GET, the host is www.scottklement.com, and the "data portion" is /presentations/Web%20Services%20from%20RPG%20with%20HTTPAPI.pdf. Furthermore, the user-agent was sent as http-api/1.24.

> I think this is creating a post like this:
> http://myurl?request=...xmldata here....

That is the format of GET (which is similar to the format of POST :) ). But you can be sure it is POST because you are calling the http_url_post routine! In your debug listing, you will see the word POST. A little further down the debug you will find senddoc(). Your data is there.
 
You never actually said what PROBLEM you are having. If your program isn't working, one thing you might want to check is the format of xxdata. Usually (following conventions in the EXAMPLE programs) this is a variable length field and %ADDR points to the field length portion of the variable. You want it to point to the data portion of the field. This would be %ADDR(xxdata: *data) if on V6R1 or later. In previous releases you might use %addr(xxdata) + 2.

> http_url_encoder_addvar
If it were me...I'd move this to the webform support. Scott made a nice enhancement a bit ago to make this a little easier to work with and I think more intuitively. Browse the examples and you will see it being used for both POST and GET applications.

 
________________________________________
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of pherrick@xxxxxxxxxx [pherrick@xxxxxxxxxx]
Sent: Friday, July 20, 2012 17:43
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Need XMLREQUEST= using http_url_post

I am using http_url_post like this:

C                   eval      rc = http_url_post(
C                                  %trimr(XURL)  :
C                                  %ADDR(xxdata) :
C                                  %len(%trimr(xxdata)):
C                                  Filename)

Where Xurl is = HTTP://myurl.com
and xxdata is = to XML data, and
Filename is a file to receive the response on the IFS.

I think this is creating a post like this:
http://myurl?request=...xmldata here....
my question is:  is this so?  how can I see the actual request that is being made?  the httpapi_debug
does not show the actual request with the url and the formatted request.

and How can I make sure the request is using http://myurl.com?XMLREQUEST= ...XML data here...?

Do I have to use the http_url_post_xml to get a a XMLREQUEST= in the url post?

I was able to use the http_url_encoder_addvar(enc : 'XMLREQUEST' : 'XML DATA HERE')
using the http_URL_GET to create the XMLREQUEST, but I need to use a Post, not a Get.

I hope this is enough info to clearly communicate my question.

Thanks
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

This email is confidential, intended only for the named recipient(s) above and may contain information that is privileged.  If you have received this message in error or are not the named recipient(s), please notify the sender immediately and delete this email message from your computer as any and all unauthorized distribution or use of this message is strictly prohibited.  Thank you.
-----------------------------------------------------------------------
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
-----------------------------------------------------------------------