iT邦幫忙

0

swift、android 無法做http post

<?php  

print_r($_POST);

這是我Server端的程式碼 (PHP)

http://ithelp.ithome.com.tw/upload/images/20170117/20104073UpksbngDDE.jpg
http://ithelp.ithome.com.tw/upload/images/20170117/20104073OT8V5YE5tx.jpg
這是Cline端 (swift)

測試了兩天都接收不到
目前有嘗試的方式
Cline端

  1. 修改info使他可以對非https做請求 (Server是http)
  2. 用html做post (成功)

Server端

  1. 修改php.ini的enable_post_data_reading = On
  2. $_REQUEST

在這之前是先測試GET
可以正確的接收到資料

POST時卻是空的但有連線到(回傳資料OK)
有請各位大神

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

2
海綿寶寶
iT邦大神 1 級 ‧ 2017-01-17 11:31:44
最佳解答

參考看看StackOverflow 的解答

在下有一事不明
這問題跟 Android(Studio) 有什麼關係嗎
/images/emoticon/emoticon19.gif

neji0924 iT邦新手 5 級 ‧ 2017-01-17 11:39:37 檢舉

不好意思忘了說 用Android(Studio)寫結果跟swift一樣

如果是這樣的話
就有可能「不是 Swift 程式寫法的問題」
而是其他問題
/images/emoticon/emoticon10.gif

neji0924 iT邦新手 5 級 ‧ 2017-01-17 12:02:34 檢舉

/images/emoticon/emoticon02.gif

我要發表回答

立即登入回答