I
I
Ilya Shatilov2017-08-31 18:13:40
API
Ilya Shatilov, 2017-08-31 18:13:40

Why do HTML tags appear in the API response?

I made an API on the site that returns a JSON response! But when I decode it with json_decode() it returns null! All this because of HTML tags!
The question is why are they there? I do not prescribe them in the API response!
Answer example:

<html><head></head><body>{"code":"200","message":"OK","data":"0"}</body></html>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Shatilov, 2018-01-31
@FogGetrof

If you encounter this problem, then it is most likely due to the fact that your php script does not work in CGI!
If it is not possible to enable CGI, you will have to additionally process the response and remove all html tags!

A
Alexander Pushkarev, 2017-08-31
@AXP-dev

Answer example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question