๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ก Tool ์‚ฌ์šฉ๊ฟ€ํŒ

Intellij HTTP Client Plugins

์š”์ฆ˜ Intellij์˜ ํŽธ๋ฆฌํ•จ๊ณผ ๊ธฐ๋Šฅ์— ๋น ์ ธ์„œ ์ด๊ฒƒ์ €๊ฒƒ ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ณด๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค ๐Ÿ™‚

์ˆœ์ˆ˜ shell ๋ง๊ณ  vscode๋„ ๋ฐฐ์ฒ™ ํ–ˆ์—ˆ๋Š”๋ฐ.. ์ข‹์€๊ฒŒ ์žˆ์œผ๋ฉด ์”์‹œ๋‹ค.

๋‚จ๋“ค์ด ์ข‹๋‹ค๊ณ  ํ•˜๋Š”๋ฐ๋Š” ์ด์œ ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

HTTP Client Plugin์œผ๋กœ์›น ์„œ๋น„์Šค๋ฅผ ๊ฐœ๋ฐœํ•  ๋•Œ ~ ๊ฐœ๋ฐœ ํ›„ ์„œ๋น„์Šค ~๊ธฐ๋Šฅ ๊ฒ€์ฆ ํ•˜๊ธฐ ์ „์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ต๋‹ˆ๋‹ค.

์ €๋Š” ๋‹ค๋ฅธ ์„œ๋น„์Šค ํ…Œ์ŠคํŠธํ•  ๋•Œ๋Š” Postman์ด๋ž‘ Insomnia๋กœ ํ–ˆ์—ˆ๋Š”๋ฐ,

์ด ๊ธฐ๋Šฅ์œผ๋กœ๋„ ํ…Œ์ŠคํŠธ ํ•ด๋ณด๊ณ  ๋” ํŽธํ•œ ๊ฑธ๋กœ ์ž‘์—…ํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค

https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html#composing-http-requests

 

HTTP Client | IntelliJ IDEA

 

www.jetbrains.com

[HTTP Client | IntelliJ IDEA

www.jetbrains.com](https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html#composing-http-requests)

 

^^ ๊ณต์‹ ๋ฌธ์„œ๋„ ์ฐธ๊ณ ํ•˜์„ธ์š”

๐ŸŒฑ Install Plugin

File - Settings - Plugins๋กœ ๊ฐ€์ค๋‹ˆ๋‹ค.

 

๐ŸŒฑCreate HTTP request files

์„ค์น˜๋ฅผ ํ•ด์ค€ ๋‹ค์Œ, ์ €๋Š” src ๋””๋ ‰ํ„ฐ๋ฆฌ์™€ ๋ถ„๋ฆฌํ•ด์„œ http ๋ฉ”์‹œ์ง€๋งŒ ๊ด€๋ฆฌํ•  ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“ค์—ˆ์–ด์š”

๋‚˜์ค‘์— ๋‹ค๋ฅธ ํŒ€์›๋“ค๊ณผ ๊ณต์œ ํ•˜๊ธฐ๋„ ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™๋„ค์šฉ

 

๐ŸŒฑCompose HTTP requests

์™ผ์ชฝ ์ƒ๋‹จ์˜ + ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ์ฃผ๋ฉด HTTP Method๋ฅผ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์–ด์š”

์ถœ์ฒ˜ ๊ณต์‹ ๋ฌธ์„œ

 

๐ŸŒฑExecute HTTP requests

์ €๋Š” ๋กœ์ปฌ ์„œ๋ฒ„๋ฅผ ๋„์› ๊ณ  ์™ผ์ชฝ์— ์ดˆ๋ก์ƒ‰ โ–ถ๋งŒ ๋ˆŒ๋Ÿฌ์„œ ์‹คํ–‰ํ•ด์คฌ์Šต๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๊ฒฐ๊ณผ๋ฅผ ๋ฐ›์•„๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

 

๐ŸŒฑManage HTTP environment

ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋„ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐ™์€ ์„œ๋ฒ„ ์ฃผ์†Œ๋ฅผ ๊ณ„์† ๋ฌธ์ž๋กœ ์ž…๋ ฅํ•˜๋Š”๊ฑด ์–ด๋ ต๊ฒ ์ฅฌ?

๋งŒ๋“ค๊ณ ๋‚˜๋ฉด ์ž๋™์œผ๋กœ .json ํŒŒ์ผ์ด ๋งŒ๋“ค์–ด์ง‘๋‹ˆ๋‹ค

 

์•„๋ž˜์™€ ๊ฐ™์€ ํ˜•์‹์œผ๋กœ ๋งŒ๋“ค์–ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค

{
  "local": {
    "localhost": "localhost:8080"
  }
}

 

ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ •ํ•˜๊ณ  Run with์— ์ƒ์„ฑํ•œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ์„ค์ •ํ•ด์ฃผ๋ฉด ๋์ž…๋‹ˆ๋‹ค

 

 

{{}} ๋กœ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ๊ฐ’์„ ๊ฐ€์ ธ์™€์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ๋ฉ”์‹œ์ง€๋Š” ###์œผ๋กœ ๊ตฌ๋ถ„๋ฉ๋‹ˆ๋‹ค.

 

 

๊ทธ๋Ÿผ ์ด๋งŒ ^^7