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








沒有留言:

張貼留言

題目: 瞬間有100-200萬筆資料量進來, 如何最快安全的接收?

如果想到快, 可能直覺就是Redis, 但是... 問:瞬間有100-200萬筆資料量進來, 如果存到redis, 這樣操作有沒有可能壓垮redis? 答: 在瞬間大量資料(如100-200萬筆)快速進入Redis,確實有可能導致Redis的性能瓶頸甚至崩潰,特別是在以下情況下:...