目錄
1下載chrome瀏覽器postman插件
2安裝postman插件
3使用postman
3.1發生JSON格式PUT請求舉例
4postman與postman-rest client的區別
1下載chrome瀏覽器postman插件
免費下載地址https://download.csdn.net/download/jlq_diligence/20419181
2安裝postman插件
把下載的《postman_chrome_extension_postman插件.zip》解壓后為《postman_chrome_extension》檔案夾,



再選擇“加載已解壓的擴展程式”,選中下載的“postman_chrome_extension”檔案夾,后就安裝成功了,
安裝后的截圖如下:

3使用postman
在瀏覽器右上角點組擴展程式



postman界面分為兩部分:左邊的sidebar 右邊的request builder:快速創建幾乎所有的請求
HTTP請求的4部分:URL,請求的method,headers,body,
URL 首先需要設定的就是URL
注意:如果在輸入引數時,沒有自動decode到URL中,則可以選中引數右鍵后,選擇EncodeURIComponent(一般都會自動填充的):
同樣也可以decode,將引數生成dictionary的形式(一般都會自動填充的):
有的URL中有path變數,postman可以自動提取該path變數為一個key
點擊headers toggle:
輸入key-value時,會有自動提示的下拉面板,
3.1發生JSON格式PUT請求舉例
選中Normal后,輸入URL,URL方法后面選擇PUT,
點“Headers”,出現Headers設定,header的key輸入Content-Type,value輸入application/json,
選擇raw,格式選JSON,下面的大輸入框輸入json格式的內容,
最后,點“Send”發送請求,
配置截圖如下:

4postman與postman-rest client的區別
1、postman是獨立的軟體,可以在命令列中,搜索postman,啟動postman
2、postman-rest client是瀏覽器的插件,所以依賴chrome瀏覽器,
3、兩者都屬于postman,只是應用場景不同,postman是獨立的軟體,postman-rest client,依賴于瀏覽器,
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/289914.html
標籤:其他
