I'm using HTTPAPI to syncronize different Databases.
Now I need to send Header-Informations with the PUT-Command.
Example:
PUT /SYSTEM/ODataV4/Company('COMP')/Customer('123456')
If-Match: W/"440112715"
With "POSTMAN" there is an own categorie "Headers" - but how to implement this in RPG ?
I use:
Response = http_string('PUT':URLCust:DataU:'application/json');
PUT with If-Match Header?
Re: PUT with If-Match Header?
Basically you will need to use http_xproc to declare the procedure to add the custom headers. This is called _before_ you call the http_... function to invoke the web service. The http API will then call your routine while building the request.
Here's a snippet of what I use to invoke Zoom APIs.
Here's a snippet of what I use to invoke Zoom APIs.
Code: Select all
http_xproc( HTTP_POINT_ADDL_HEADER
: %paddr(addSpecialHeaders)
: %addr(authorizationToken) );
....
Dcl-Proc addSpecialHeaders;
Dcl-Pi *N;
headersToAdd Varchar(32767);
var like(authorizationToken) const;
End-Pi;
Dcl-c CRLF x'0d25';
headersToAdd = 'authorization: ' + var + CRLF;
End-Proc;
Re: PUT with If-Match Header?
hey jonboy49!
thnx very much - it helped.
thnx very much - it helped.