Answer the question
In order to leave comments, you need to log in
How to handle POST request response with JSON?
Hello! I don't know what to do anymore. The bottom line is this, I send a POST request, the answer comes naturally, like this .
It can be seen that the entire response, along with the headers, is in one line, and even though you crack, I can’t figure out how to get to the json itself, which is after the headers in curly braces. json_decode, (object), (array) etc don't work. I understand that you can trim the string before the opening and after the closing curly braces, but isn't there a correct way to get json from the response? Sending via curl_setopt. All in php. And, if the information is useful - the request initially comes from one service in xml, I have it parsed in json and sent via post to a third-party service, it returns in this form, which I need to parse into components and return to the first service in xml. And for the second day I can’t figure out how to get this json correctly.
Answer the question
In order to leave comments, you need to log in
why do you have headlines in the answer itself?
or something is wrong on the sending side, or you are not receiving correctly.
wangyu: uses curl with the option to get headers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question