I'm accessing a RESTFUL API using Powerbuilder. I have it working just fine however, I would like to call the API and include request headers. The reason I need this is because the API accepts a "Content-Type" request header, which can be set to either "application/xml" or "application/json".
Here is what I have done so far:
inet iinet_base
n_ir ir
GetContextService( "Internet", iinet_base )
CREATE n_ir
li_rc = iinet_base.GetURL( "http://api.com/apicall", ir )
ls_result = ir.of_getResultData_String()
The above will return the data as expected. The request must be a GET request, not a POST.
How do I add a Request Header to the GetURL request?