No JSON Returned if its not HTTP/1.1 200 OK
Posted: Mon Mar 25, 2024 5:26 pm
Hi
I am calling a web service then using DATA-INTO to receive the JSON to a DS.
When I call and get a "200 OK" message the JSON is returned without issue as the client was successfully updated on the server side.
The client can only be updated once...
When I call again with the same client details .... I get ... a "406 Not Acceptable" message and no JSON is returned!
Is this one for the programmers on the server side ?
Is there a reason the JSON does not get returned when the error occurs on the server side ?
monitor;
response = http_string('POST': url: request: 'application/json');
data-into resultDS %DATA(response:'case=any') %PARSER('YAJLINTO');
on-error;
httpCode = http_error();
apemsg = %trim(httpCode) + ' for ' + %trim(url);
exsr WriteErrorFile;
endmon;
Any input appreciated - I am a newbie to this stuff !
I am calling a web service then using DATA-INTO to receive the JSON to a DS.
When I call and get a "200 OK" message the JSON is returned without issue as the client was successfully updated on the server side.
The client can only be updated once...
When I call again with the same client details .... I get ... a "406 Not Acceptable" message and no JSON is returned!
Is this one for the programmers on the server side ?
Is there a reason the JSON does not get returned when the error occurs on the server side ?
monitor;
response = http_string('POST': url: request: 'application/json');
data-into resultDS %DATA(response:'case=any') %PARSER('YAJLINTO');
on-error;
httpCode = http_error();
apemsg = %trim(httpCode) + ' for ' + %trim(url);
exsr WriteErrorFile;
endmon;
Any input appreciated - I am a newbie to this stuff !