Hi All,
I can get the request working through Postman but my attempts fail with a 406 code.
I have tried both request types with the same result.
What the heck am I doing wrong?
Working with UPS is a pain!
Dcl-Proc SetHeader;
// ----------------------------------------------------------------------------------
// Input Parameters
// ----------------------------------------------------------------------------------
Dcl-pi *N;
Headers VarChar(1024);
End-pi;
// ----------------------------------------------------------------------------------
// Local Parameters
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
// Data Structures
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
// Mainline
// ----------------------------------------------------------------------------------
Headers = 'Username: ' + %Trim(UPSUserName) + CRLF +
'Password: ' + %Trim(UPSPassword) + CRLF +
'AccessLicenseNumber: ' + %Trim(APIKey) + CRLF;
End-Proc;
Dcl-S TrackingUrlProd VarChar(100)
Inz('https://onlinetools.ups.com/track/v1/details/');
Request = %Trim(TrackingURLProd) + %Trim(EntTrackNo);
Rc = http_xproc(HTTP_POINT_ADDL_HEADER : %paddr(SetHeader));
Rc = http_url_get( Request : ResponseFile);
// rc = http_req('GET'
// : Request
// : ResponseFile
// : *omit
// : *omit
// : *Omit
// : 'application/json');
// Load Response If No Error
If Rc = 1;
UPS Tracking Web Service Not Working
Re: UPS Tracking Web Service Not Working
I added to the header and it works now.
Content-Type: application/json
Accept: application/json
Thanks!
Content-Type: application/json
Accept: application/json
Thanks!