2023年10月26日 星期四

使用httpclient

在idea可下載工具中有httpclient

其功用很像是postman或是swagger

他的功用上, 一方面能保存測試數據, 另外一方面又比postman吃的資源少

同時因其在idea裡面, 使用上還算方便

下列簡略介紹

可以創一個資料夾專門放這些測試

裡面命名用.http結尾, 內容為以下

需要有content type, 然後~格一行可以寫requestbody

點選綠色箭頭就可以run

另外一部分可以設置環境變數, 像{{content_host}}

然後創建一個env檔案ex http-client.env.json

然後內容

{
"dev": {
"access_token": "",
"gateway_host": "localhost:63010",
"content_host": "localhost:63040",
"system_host": "localhost:63110",
"media_host": "localhost:63050",
"search_host": "localhost:63080",
"auth_host": "localhost:63070",
"checkcode_host": "localhost:63075",
"learning_host": "localhost:63020"
}
}
這樣就可以選run with 'dev' environment








沒有留言:

張貼留言

[leetcode] [KMP] KMP

ABCDABD... ABCDABF... 簡單的說, 傳統解兩字串匹配部分 可能會來個雙迴圈, 哀個比對, 當不匹配的時候, 會將下方列再後移1位 然後不匹配再後移 然而 如果像上放已經有4個屬於匹配的字串, 她就應該直接往後移四位來匹配, 而不是只移動1位 隱藏的思維是, 當...