Die API gibt Text/HTML zurück, obwohl sie JSON zurückgeben sollte

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Die API gibt Text/HTML zurück, obwohl sie JSON zurückgeben sollte

by Anonymous » 29 Dec 2024, 10:51

Ich bin neu in der Entwicklung von Webdiensten. Ich habe kein Framework verwendet. Ich habe es von Grund auf gemacht. Ich wollte einen RESTFUL-API-Dienst erstellen, den ich für meine iOS-Anwendung verwenden möchte. Aber ich erhalte eine Fehlermeldung im Zusammenhang mit dem Inhaltstyp
Dies ist mein api.php-Skript: Wenn ich versuche, die Ressource mit Hilfe von AFNetworking in iOS zu nutzen, erhalte ich die folgende Fehlermeldung.

Code: Select all

"Request failed: unacceptable content-type: text/html" UserInfo={AFNetworkingOperationFailingURLResponseErrorKey= { URL: http://........../....../api.php/customers } { status code: 200, headers {
Connection = "keep-alive";
"Content-Encoding" = gzip;
"Content-Type" = "text/html";
Date = "Tue, 29 Dec 2015 11:16:01 GMT";
Server = "nginx/1.8.0";
"Transfer-Encoding" = Identity;
} }, NSLocalizedDescription=Request failed: unacceptable content-type: text/html, NSErrorFailingURLKey=http://........../....../api.php/customers}
Kann mir bitte jemand helfen, das Problem von der API-Seite aus zu lösen?

Top