0
我創建基於休息的應用程序,並當我向服務器url發出請求時: 例如:107.XXX.XXX.XXX:8080/taxi - 它的工作,返回給我JSON。 但是,當我提出請求轉發到該IP我的應用程序域我表明例外:iOS應用程序調用重定向域
2017-04-18 20:23:53.063 Project X[4121:301275] http://107.XXX.XXX.XXX:8080/taxi 2017-04-18 20:23:53.065 Project X[4121:301275] fireGetWebserviceCall finally 2017-04-18 20:23:53.252 Project X[4121:301275] Error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: not found (404)" UserInfo={NSUnderlyingError=0x600000240600 {Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={com.alamofire.serialization.response.error.response= { URL: http://107.XXX.XXX.XXX:8080/taxi } { status code: 404, headers { "Content-Language" = en; "Content-Length" = 977; "Content-Type" = "text/html;charset=utf-8"; Date = "Tue, 18 Apr 2017 17:23:51 GMT"; Server = "Apache-Coyote/1.1"; } }
當我粘貼網址到瀏覽器中,我得到正常的JSON響應。 有人可以向我解釋爲什麼返回的信息是文本/ HTML和如何解決它?