簡體   English   中英

為什么 postman 發布請求不發送正文變量?

[英]Why does the postman post request not send body variables?

我正在嘗試通過 Postman 發送一個普通的 POST 請求。 我通過 Curl 做了同樣的事情,我的服務器看到它很好。 下面是 Body 的設置:

郵遞員,明文 POST 正文

這是控制台中的請求:

郵遞員控制台

我的快遞服務器沒有看到正文變量。 使用 curl 像這樣:

curl -X POST https://xxx.appspot.com -d "volume=123&content=foobar"

我需要改變什么才能使它起作用?

這兩個示例不等效,因為使用 Postman 您有Content-Type: text/plain header 設置,但通過curl -d選項發送數據,設置Content-Type: application/x-www-form-urlencoded 來自curl手冊頁:

-d, --data <data>
              (HTTP MQTT) Sends the specified data in a POST  request  to  the
              HTTP server, in the same way that a browser does when a user has
              filled in an HTML form and presses the submit button. This  will
              cause curl to pass the data to the server using the content-type
              application/x-www-form-urlencoded.

我對 Postman 沒有任何經驗,但我猜你需要 select x-www-form-urlencoded按鈕而不是當前的raw按鈕。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM