iT邦幫忙

1

postman 測試API POST 出現 stus415

  • 分享至 

  • xImage

您好:
參考:
https://igouist.github.io/post/2021/05/newbie-2-webapi/

實測
卻出現 415

https://ithelp.ithome.com.tw/upload/images/20231224/20104095jp7vw1zhZ6.png

https://ithelp.ithome.com.tw/upload/images/20231225/20104095dv6VZ5Yj0P.png

但執行時他自己出現的網頁是可以執行的
https://ithelp.ithome.com.tw/upload/images/20231224/20104095x7XhWcsGEg.png

想請問
該如何在postman測試 新增/修改/刪除呢?
謝謝

看更多先前的討論...收起先前的討論...
alien663 iT邦研究生 5 級 ‧ 2023-12-25 07:55:39 檢舉
Header的Contetn-Type要設定好
https://blog.csdn.net/majinggogogo/article/details/78383772
noway iT邦研究生 3 級 ‧ 2023-12-25 09:16:41 檢舉
您好:
之前有看其他PO有設過,但沒有效
alien663 iT邦研究生 5 級 ‧ 2023-12-25 10:08:25 檢舉
你的Content-Type設定能秀出來嗎?
noway iT邦研究生 3 級 ‧ 2023-12-25 23:06:58 檢舉
您好:
已經放上去了
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
1
allenlwh
iT邦高手 1 級 ‧ 2023-12-25 10:10:03
最佳解答

我是使用json格式傳送資料(Content-Type: application/json)

https://ithelp.ithome.com.tw/upload/images/20231225/20033493YZUEcE3SIe.jpghttps://ithelp.ithome.com.tw/upload/images/20231225/20033493GzZTBnG8ew.jpghttps://ithelp.ithome.com.tw/upload/images/20231225/20033493l3v0G0LwuX.jpg

看更多先前的回應...收起先前的回應...
noway iT邦研究生 3 級 ‧ 2023-12-25 23:04:58 檢舉

參考用allenlwh 的方式 raw, POST可以過
但用form-data 無法過?

noway iT邦研究生 3 級 ‧ 2023-12-25 23:13:29 檢舉

順便請教一下
若要把這一個專案,搬到IIS
直接開一個IIS 目錄來做,再把ProjectN檔案 複製到該目錄下即可?
PORT 也需要設一樣?
或其他需要設定的?
謝謝

allenlwh iT邦高手 1 級 ‧ 2023-12-26 11:14:39 檢舉

noway 好像不行,我還在Try如何移到IIS上

noway iT邦研究生 3 級 ‧ 2023-12-26 22:44:03 檢舉

謝謝!
有成功經驗,再請不吝賜教

allenlwh iT邦高手 1 級 ‧ 2024-01-04 12:03:26 檢舉
allenlwh iT邦高手 1 級 ‧ 2024-01-05 14:55:30 檢舉

noway已補上移到IIS的方法

0
Yaowen
iT邦研究生 4 級 ‧ 2023-12-25 15:52:55

swagger
打完底下有 Curl
copy 過去 postman 就好

janlin002 iT邦好手 1 級 ‧ 2023-12-25 16:22:39 檢舉

/images/emoticon/emoticon34.gif

0
sabinaholt
iT邦新手 5 級 ‧ 2024-02-12 20:53:31

Agree, just go postman

我要發表回答

立即登入回答