http_string not returning failure details
Posted: Fri Mar 18, 2022 7:29 pm
Hello, i am doing http_string call as follow
Monitor;
result = http_string( 'POST': url: postdata: 'application/json')
On-Error *ALL;
If result <> ' ';
...
EndIf;
EndMon;
When there these is issue in the message i am sending, it raises exception and control goes to On-Error section and result field does not have any data. When i look at log there is failure cause returned from server :{"code":"S0001","message":["#/customs_form/customs_items/0/quantity: failed sche", i want to read this error message inside my program, please help how to do that?
Log:
senddoc(): entered
{ "request_id" : "F90-0000000092", "order_number" : "OOGP0007552362", "from_addr
recvresp(): entered
HTTP/1.1 422 Unprocessable Entity
Server: nginx/1.19.0
Date: Fri, 18 Mar 2022 19:14:38 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
SetError() #13: HTTP/1.1 422 Unprocessable Entity
recvresp(): end with 422
recvdoc parms: chunked 0
header_load_cookies() entered
recvchunk(): entered
get_chunk_size(): entered
b7
chunk size = 183
get_chunk_size returned 183
calling comm_blockread
{"code":"S0001","message":["#/customs_form/customs_items/0/quantity: failed sche
comm_blockread returned 183
Monitor;
result = http_string( 'POST': url: postdata: 'application/json')
On-Error *ALL;
If result <> ' ';
...
EndIf;
EndMon;
When there these is issue in the message i am sending, it raises exception and control goes to On-Error section and result field does not have any data. When i look at log there is failure cause returned from server :{"code":"S0001","message":["#/customs_form/customs_items/0/quantity: failed sche", i want to read this error message inside my program, please help how to do that?
Log:
senddoc(): entered
{ "request_id" : "F90-0000000092", "order_number" : "OOGP0007552362", "from_addr
recvresp(): entered
HTTP/1.1 422 Unprocessable Entity
Server: nginx/1.19.0
Date: Fri, 18 Mar 2022 19:14:38 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
SetError() #13: HTTP/1.1 422 Unprocessable Entity
recvresp(): end with 422
recvdoc parms: chunked 0
header_load_cookies() entered
recvchunk(): entered
get_chunk_size(): entered
b7
chunk size = 183
get_chunk_size returned 183
calling comm_blockread
{"code":"S0001","message":["#/customs_form/customs_items/0/quantity: failed sche
comm_blockread returned 183