Answer the question
In order to leave comments, you need to log in
How to change Content Type in Yii2 received during OAuth authentication?
Hello.
Implementing user authentication through Mail.ru ran into a problem.
The error falls out:
Unable to detect format for content parsing. Raw response:
Http-Code: 200
Server: nginx
Date: Sat, 18 Mar 2017 04:26:47 GMT
Content-Type: text/javascript; charset=utf-8
Content-Length: 2499
Connection: close
P3p: policyref="/w3c/p3p.xml", CP="NON CUR ADM DEV PSA PSD OUR IND UNI NAV INT STA"
The essence of the problem is clear, but how to solve it? How to change the resulting format for the parser?
to come back to the beginning
Answer the question
In order to leave comments, you need to log in
Everything turned out to be easier than ever.
$response->setFormat(\yii\web\Response::FORMAT_JSON);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question