我遇到HTTP請求問題。在Ionic View,瀏覽器和Android中一切正常,但不能在IOS上工作。 GET請求也可以在IOS上正常工作。任何猜測,那可能是什麼?POST請求無法在Ionic2中使用IOS應用
我可以爲您提供更多信息,只需告訴我您需要什麼信息。以下是我的package.json中的內容:
"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@ionic/cloud-angular": "0.7.0",
"@ionic/storage": "1.1.7",
"@types/moment-timezone": "0.2.32",
"ionic-angular": "2.0.0-rc.4",
"ionic-native": "2.4.1",
"ionicons": "3.0.0",
"moment": "2.15.1",
"moment-timezone": "0.5.7",
"ng2-translate": "5.0.0",
"rxjs": "^5.0.0-beta.12",
"zone.js": "0.6.26"
},
"devDependencies": {
"@ionic/app-scripts": "^1.0.0",
"sw-toolbox": "^3.4.0",
"typescript": "2.0.9"
},
後端接收發布請求的空白主體。這裏是我回來的:
ERROR: {"_body":"{\"error\":\"Sign up error\",\"message\":{\"first_name\":[\"First Name cannot be blank.\"],\"last_name\":[\"Last Name cannot be blank.\"],\"email\":[\"Email cannot be blank.\"],\"device_id\":[\"Device Id cannot be blank.\"]}}","status":422,"ok":false,"statusText":"Bad Request","headers":{"Content-Type":["application/json; charset=UTF-8"],"Pragma":["no-cache"]},"type":2,"url":"http://app.EDITED"}
隨意問任何事,並感謝您的幫助!
UPDATE:我們感動我們的後端HTTPS,現在一切工作正常:)
向我們展示你的代碼,請,不能調試我們看不到。 – Ivaro18
不幸的是,合同不允許我這樣做。我只是發現在我的代碼中的HTTPS POST請求在IOS上工作正常,所以我想這個問題只是在使用HTTP url –
有類似的問題,https解決了這個問題,但這使我非常不舒服。在離子發表了一個問題 - https://forum.ionicframework.com/t/ionic2-rc5-body-removed-from-post-put-calls/77591目前爲止沒有迴應 –