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

Re: HTTP Request Header



   Thanks Mike!
   It works perfectly.

   On Wed, Sep 9, 2015 at 9:28 AM, Mike Krebs
   <[1]mkrebs@xxxxxxxxxxxxxxxxxx> wrote:

     Additional header is relatively easy to add. You create a procedure
     that will return your headers. Then you set an exit point that
     points to your procedure. The exit point is called during the send
     and sends whatever the procedure says. Headers end with CRLF so be
     sure to include as part of the string (see below).
     To set the exit point, put this in the main:
     http_xproc( HTTP_POINT_ADDL_HEADER
     � � � � � � � � � : %paddr(YourHeaderProcedureNameHere) );
     The procedure pointed to by the %paddr looks like this:
     D addl_headers� � PR� � � � � � � � � ExtProc(
     D� �peAddlHdrs� � � � � � � �32767A� �varying
     D� �peUserData� � � � � � � � � � *� �value
     And can be coded similar to this (notice you do not have to do
     anything with the peUserData unless you want to. This would be for
     passing in your data):
     P YourHeaderProcedureNameHere...
     � � � � � � � � � � � B
     D� � � � � � � � �PI
     D� �headers� � � � � � � � � 32767a� �varying
     D CRLF� � � � � � C� � � � � � � � � �x'0d25'
     � �headers = 'X-Standardize-Only: true' + CRLF;
     P� � � � � � � � �E

   -----Original Message-----
   From: [2]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   [mailto:[3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Chris
   Edmondson
   Sent: Tuesday, September 8, 2015 7:21 PM
   To: [4]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   Subject: HTTP Request Header
   Hi Scott,
   I'm using your http api on As400 at v6r1 to submit address validation
   requests to [5]smartystreets.com street address validation web service.
   I'm creating a GET request which is working great but, in order to get
   some additional information from the web service, I need to specify a
   certain http request header. I cannot figure out how to do this, am
   hoping you can point me in the right direction.
   Here's what smartystreets says I need to send:
   [6]https://smartystreets.com/docs/address#http-request-headers
   Specifically it's the first one, X-Standardize-Only: true.
   This is the code which presently works:
   >
   >� url� = '[7]https://api.smartystreets.com/street-address'
   >� � �+ '?auth-id=xxxxxxxx'
   >� � �+ '&auth-token=xxxx';
   >� � �Form = WEBFORM_open();
   >� � �WEBFORM_setVar(Form : 'street'� � � : %trim(adrs));
   >� � �WEBFORM_setVar(Form : 'secondary'� �: %trim(adrs2));
   >� � �WEBFORM_setVar(Form : 'city'� � � � : %trim(city));
   >� � �WEBFORM_setVar(Form : 'state'� � � �: %trim(state2));
   >� � �WEBFORM_setVar(Form : 'zipcode'� � �: %trim(zip));
   >
   >� � �url = url + WEBFORM_getData(Form);
   >
   >� � �WEBFORM_Close(Form);
   >
   > � � �  > rc = http_url_get(url: tempFile);
   >
   >
   �anks,�  --
   Chris Edmondson
   [8]509.670.6817

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

   --
   Chris Edmondson
   509.670.6817

References

   1. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
   2. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   4. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   5. http://smartystreets.com/
   6. https://smartystreets.com/docs/address#http-request-headers
   7. https://api.smartystreets.com/street-address
   8. tel:509.670.6817
   9. 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
-----------------------------------------------------------------------