사용자 도구

사이트 도구


intellij_idea:dot_http

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
intellij_idea:dot_http [2019/03/14 16:19]
kwon37xi
intellij_idea:dot_http [2023/03/10 10:19] (현재)
kwon37xi
줄 1: 줄 1:
 ====== IntelliJ IDEA .HTTP ====== ====== IntelliJ IDEA .HTTP ======
 +  * [[:intellij_idea|IntelliJ IDEA]] HTTP Client - [[mailto:marketplace@jetbrains.com|HTTP Client - IntelliJ IDEs Plugin]]
   * [[https://www.jetbrains.com/help/idea/testing-restful-web-services.html|Testing RESTful Web Services - Help | IntelliJ IDEA]]   * [[https://www.jetbrains.com/help/idea/testing-restful-web-services.html|Testing RESTful Web Services - Help | IntelliJ IDEA]]
   * [[https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html|HTTP Client in IntelliJ IDEA Code Editor - Help | IntelliJ IDEA]]   * [[https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html|HTTP Client in IntelliJ IDEA Code Editor - Help | IntelliJ IDEA]]
줄 5: 줄 6:
   * ''프로젝트폴더/.idea/httpRequests/'' 에 로그 남음   * ''프로젝트폴더/.idea/httpRequests/'' 에 로그 남음
   * **Tools -> HTTP Client -> Test RESTFul Web Service** Rest Client 를 사용하여 테스트하는 것도 가능   * **Tools -> HTTP Client -> Test RESTFul Web Service** Rest Client 를 사용하여 테스트하는 것도 가능
 +  * [[https://blog.jetbrains.com/idea/2022/12/http-client-cli-run-requests-and-tests-on-ci/|명령행 http-client cli]]
  
 ===== Profile 지정 ===== ===== Profile 지정 =====
   * 프로필별 대체 정보를 json 으로 만들어 두면 ''%%{{host}}%%'' 등으로 지정한 값이 프로필에 설정한 값으로 변경된다.   * 프로필별 대체 정보를 json 으로 만들어 두면 ''%%{{host}}%%'' 등으로 지정한 값이 프로필에 설정한 값으로 변경된다.
-  * ''http-client.env.json''<code>+  * ''http-client.env.json'' : 전체 공개 내용.<code>
 { {
     "development": {     "development": {
줄 27: 줄 29:
 } }
 </code> </code>
-  * ''http-client.private.env.json''<code>+  * ''http-client.private.env.json'' : 개인별 설정. 비밀번호 등을 저장. ''.gitignore'' 등을 통해 저장소 공유는 막아야한다.<code>
 { {
     "development": {     "development": {
줄 64: 줄 66:
 </code> </code>
  
 +===== 결과 재사용 / 저장 =====
 +  * HTTP Client 실행 결과를 저장하고 재사용할 수 있다.
 +  * [[https://www.jetbrains.com/help/idea/http-response-handling-examples.html|Response handling examples | IntelliJ IDEA]] 참조
 +
 +<code>
 +POST https://httpbin.org/post
 +Content-Type: application/json
 +
 +{
 +    "token": "my-secret-token"
 +}
 +
 +// "auth_token"이라는 변수로 값을 저장.
 +> {%
 +    client.global.set("auth_token", response.body.json.token);
 +%}
 +</code>
 +저장된 값을 사용하려면,
 +<code>
 +GET https://httpbin.org/headers
 +Authorization: Bearer {{auth_token}}
 +</code>
 +  * 
 +===== Spring Web MVC Controller 실행 =====
 +  * [[springframework:springboot:actuator|Spring Boot Actuator]] 를 추가한 상태에서 애플리케이션을 실행하고 나면,
 +  * 컨트롤러 메소드의 컨텍스트 메뉴에 **Run HTTP Request** 가 생겨서 요청을 테스트해 볼 수 있게 된다.
  
intellij_idea/dot_http.1552547990.txt.gz · 마지막으로 수정됨: 2019/03/14 16:19 저자 kwon37xi