Top

Rest Client on VSCODE

REST 클라이언트를 사용하면 HTTP 요청을 보내고 Visual Studio Code에서 직접 응답을 볼 수 있습니다.

주요 특징

사용법

편집기에서 아래와 같이 간단한 HTTP 요청을 입력합니다.

https://example.com/comments/1

또는 요청 방법, 헤더 및 본문을 포함 하는 표준 RFC 2616 을 따를 수 있습니다 .

POST https://example.com/comments HTTP/1.1
content-type: application/json

{
    "name": "sample",
    "time": "Wed, 21 Oct 2015 18:27:50 GMT"
}

요청을 준비했으면 요청 Send Request위의 링크를 클릭하거나 (파일의 언어 모드가 HTTP기본적으로 .http다음과 같은 경우 나타납니다) 바로 가기를 사용하거나 Ctrl+Alt+R ( Cmd+Alt+RmacOS의 경우) 편집기에서 마우스 오른쪽 버튼을 클릭한 Send Request 다음 메뉴를 누르거나 를 누른 F1다음 선택/입력 하면 Visual Studio Code의 Rest Client: Send Request별도 웹 보기 패널에서 응답을 미리 볼 수 있습니다 . Visual Studio Code에서 검색, 선택 또는 조작의 모든 기능을 사용하려는 경우 다음으로 설정 하여 제목 없는 문서 에서 응답을 미리 볼 수도 있습니다. rest-client.previewResponseInUntitledDocumenttrue. 요청이 발행되면 응답이 수신될 때까지 대기 중인 스핀 아이콘이 상태 표시줄에 표시됩니다. 스핀 아이콘을 클릭하여 요청을 취소할 수 있습니다. 그 후 아이콘은 총 기간 및 응답 크기로 바뀝니다.

상태 표시줄에서 총 기간 위로 마우스를 가져가면 응답 시간 분석을 볼 수 있으며 Socket, DNS, TCP, First Byte 및 Download의 기간 세부 정보를 볼 수 있습니다 .

상태 표시줄에서 응답 크기 위로 마우스를 가져가면 헤더 및 본문의 세부 응답 크기 세부 정보를 볼 수 있습니다.

REST Client Extension의 모든 바로 가기는 파일 언어 모드 httpplaintext.

각 요청 위의 요청 보내기 링크는 요청 파일이 http 모드일 때만 볼 수 있습니다. 자세한 내용은 http 언어 섹션 에서 찾을 수 있습니다 .

요청 텍스트 선택

동일한 파일에 수많은 요청을 저장하고 원하는 대로 쉽게 실행할 수도 있습니다. REST 클라이언트 확장은 세 개 이상의 연속 #으로 시작하는 줄로 구분된 요청을 구분 기호로 인식할 수 있습니다. 구분 기호 사이에 커서를 놓고 위와 같이 요청하면 기본 요청이 전송됩니다.

GET https://example.com/comments/1 HTTP/1.1

###

GET https://example.com/topics/1 HTTP/1.1

###

POST https://example.com/comments HTTP/1.1
content-type: application/json

{
    "name": "sample",
    "time": "Wed, 21 Oct 2015 18:27:50 GMT"
}

REST 클라이언트 확장은 또한 편집기에서 선택한 텍스트와 함께 요청을 보낼 수 있는 유연성을 제공합니다.

설치

을 누르고 F1를 입력 ext install한 다음 검색하십시오 rest-client.

요청하기

휴식 클라이언트

요청 라인

선택 항목(또는 아무것도 선택되지 않은 경우 문서)의 비어 있지 않은 첫 번째 줄은 요청 줄입니다. 다음은 요청 라인의 몇 가지 예입니다 .

GET https://example.com/comments/1 HTTP/1.1
GET https://example.com/comments/1
https://example.com/comments/1

요청 메소드를 생략하면 요청이 GET으로 처리 되므로 위의 요청은 파싱 후에도 동일합니다.

쿼리 문자열

다음과 같이 요청 라인에 항상 쿼리 문자열을 작성할 수 있습니다.

GET https://example.com/comments?page=2&pageSize=10

때로는 단일 요청에 여러 쿼리 매개변수가 있을 수 있으며 모든 쿼리 매개변수를 요청 라인 에 넣는 것은 읽고 수정하기 어렵습니다. 따라서 쿼리 매개변수를 여러 줄로 분산할 수 있습니다(한 줄에 쿼리 매개변수 한 줄). 및 로 시작 하는 요청 줄 바로 뒤에 있는 줄을 구문 분석합니다.?&

GET https://example.com/comments
    ?page=2
    &pageSize=10

헤더 요청

The lines immediately after the request line to first empty line are parsed as Request Headers. Please provide headers with the standard field-name: field-value format, each line represents one header. By default REST Client Extension will add a User-Agent header with value vscode-restclient in your request if you don’t explicitly specify. You can also change the default value in setting rest-client.defaultHeaders. Below are examples of Request Headers:

User-Agent: rest-client
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6,zh-CN;q=0.4
Content-Type: application/json

Request Body

If you want to provide the request body, please add a blank line after the request headers like the POST example in usage, and all content after it will be treated as Request Body. Below are examples of Request Body:

POST https://example.com/comments HTTP/1.1
Content-Type: application/xml
Authorization: token xxx

<request>
    <name>sample</name>
    <time>Wed, 21 Oct 2015 18:27:50 GMT</time>
</request>

You can also specify file path to use as a body, which starts with <, the file path(whitespaces should be preserved) can be either in absolute or relative(relative to workspace root or current http file) formats:

POST https://example.com/comments HTTP/1.1
Content-Type: application/xml
Authorization: token xxx

< C:\Users\Default\Desktop\demo.xml
POST https://example.com/comments HTTP/1.1
Content-Type: application/xml
Authorization: token xxx

< ./demo.xml

If you want to use variables in that file, you’ll have to use an @ to ensure variables are processed when referencing a file (UTF-8 is assumed as the default encoding)

POST https://example.com/comments HTTP/1.1
Content-Type: application/xml
Authorization: token xxx

<@ ./demo.xml

to override the default encoding, simply type it next to the @ like the below example

POST https://example.com/comments HTTP/1.1
Content-Type: application/xml
Authorization: token xxx

<@latin1 ./demo.xml

When content type of request body is multipart/form-data, you may have the mixed format of the request body as follows:

POST https://api.example.com/user/upload
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="text"

title
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"; filename="1.png"
Content-Type: image/png

< ./1.png
------WebKitFormBoundary7MA4YWxkTrZu0gW--

When content type of request body is application/x-www-form-urlencoded, you may even divide the request body into multiple lines. And each key and value pair should occupy a single line which starts with &:

POST https://api.example.com/login HTTP/1.1
Content-Type: application/x-www-form-urlencoded

name=foo
&password=bar

When your mouse is over the document link, you can Ctrl+Click(Cmd+Click for macOS) to open the file in a new tab.

Making GraphQL Request

With GraphQL support in REST Client extension, you can author and send GraphQL query using the request body. Besides that you can also author GraphQL variables in the request body. GraphQL variables part in request body is optional, you also need to add a blank line between GraphQL query and variables if you need it.

You can specify a request as GraphQL Request by adding a custom request header X-Request-Type: GraphQL in your headers. The following code illustrates this:

POST https://api.github.com/graphql
Content-Type: application/json
Authorization: Bearer xxx
X-REQUEST-TYPE: GraphQL

query ($name: String!, $owner: String!) {
  repository(name: $name, owner: $owner) {
    name
    fullName: nameWithOwner
    description
    diskUsage
    forkCount
    stargazers(first: 5) {
        totalCount
        nodes {
            login
            name
        }
    }
    watchers {
        totalCount
    }
  }
}

{
    "name": "vscode-restclient",
    "owner": "Huachao"
}

Making cURL Request

cURL 요청 We add the capability to directly run curl request in REST Client extension. The issuing request command is the same as raw HTTP one. REST Client will automatically parse the request with specified parser.

REST Client doesn’t fully support all the options of cURL, since underneath we use request library to send request which doesn’t accept all the cURL options. Supported options are listed below:

Copy Request As cURL

Sometimes you may want to get the curl format of an http request quickly and save it to clipboard, just pressing F1 and then selecting/typing Rest Client: Copy Request As cURL or simply right-click in the editor, and select Copy Request As cURL.

Cancel Request

Once you want to cancel a processing request, click the waiting spin icon or use shortcut Ctrl+Alt+K(Cmd+Alt+K for macOS), or press F1 and then select/type Rest Client: Cancel Request.

Rerun Last Request

Sometimes you may want to refresh the API response, now you could do it simply using shortcut Ctrl+Alt+L(Cmd+Alt+L for macOS), or press F1 and then select/type Rest Client: Rerun Last Request to rerun the last request.

Request History

요청 기록 Each time we sent an http request, the request details(method, url, headers, and body) would be persisted into file. By using shortcut Ctrl+Alt+H(Cmd+Alt+H for macOS), or press F1 and then select/type Rest Client: Request History, you can view the last 50 request items(method, url and request time) in the time reversing order, you can select any request you wish to trigger again. After specified request history item is selected, the request details would be displayed in a temp file, you can view the request details or follow previous step to trigger the request again.

You can also clear request history by pressing F1 and then selecting/typing Rest Client: Clear Request History.

Save Full Response

응답 저장 In the upper right corner of the response preview tab, we add a new icon to save the latest response to local file system. After you click the Save Full Response icon, it will prompt the window with the saved response file path. You can click the Open button to open the saved response file in current workspace or click Copy Path to copy the saved response path to clipboard.

Save Response Body

Another icon in the upper right corner of the response preview tab is the Save Response Body button, it will only save the response body ONLY to local file system. The extension of saved file is set according to the response MIME type, like if the Content-Type value in response header is application/json, the saved file will have extension .json. You can also overwrite the MIME type and extension mapping according to your requirement with the rest-client.mimeAndFileExtensionMapping setting.

"rest-client.mimeAndFileExtensionMapping": {
    "application/atom+xml": "xml"
}

Fold and Unfold Response Body

In the response webview panel, there are two options Fold Response and Unfold Response after clicking the More Actions... button. Sometimes you may want to fold or unfold the whole response body, these options provide a straightforward way to achieve this.

Authentication

We have supported some most common authentication schemes like Basic Auth, Digest Auth, SSL Client Certificates, Azure Active Directory(Azure AD) and AWS Signature v4.

Basic Auth

HTTP Basic Auth is a widely used protocol for simple username/password authentication. We support three formats of Authorization header to use Basic Auth.

  1. Add the value of Authorization header in the raw value of username:password.
  2. Add the value of Authorization header in the base64 encoding of username:password.
  3. Add the value of Authorization header in the raw value of username and password, which is separated by space. REST Client extension will do the base64 encoding automatically.

The corresponding examples are as follows, they are equivalent:

GET https://httpbin.org/basic-auth/user/passwd HTTP/1.1
Authorization: Basic user:passwd

and

GET https://httpbin.org/basic-auth/user/passwd HTTP/1.1
Authorization: Basic dXNlcjpwYXNzd2Q=

and

GET https://httpbin.org/basic-auth/user/passwd HTTP/1.1
Authorization: Basic user passwd

Digest Auth

HTTP Digest Auth is also a username/password authentication protocol that aims to be slightly safer than Basic Auth. The format of Authorization header for Digest Auth is similar to Basic Auth. You just need to set the scheme to Digest, as well as the raw user name and password.

GET https://httpbin.org/digest-auth/auth/user/passwd
Authorization: Digest user passwd

SSL Client Certificates

We support PFX, PKCS12, and PEM certificates. Before using your certificates, you need to set the certificates paths(absolute/relative to workspace/relative to current http file) in the setting file for expected host name(port is optional). For each host, you can specify the key cert, key, pfx and passphrase.

"rest-client.certificates": {
    "localhost:8081": {
        "cert": "/Users/demo/Certificates/client.crt",
        "key": "/Users/demo/Keys/client.key"
    },
    "example.com": {
        "cert": "/Users/demo/Certificates/client.crt",
        "key": "/Users/demo/Keys/client.key"
    }
}

Or if you have certificate in PFX or PKCS12 format, setting code can be like this:

"rest-client.certificates": {
    "localhost:8081": {
        "pfx": "/Users/demo/Certificates/clientcert.p12",
        "passphrase": "123456"
    }
}

Azure Active Directory(Azure AD)

Azure AD is Microsoft’s multi-tenant, cloud-based directory and identity management service, you can refer to the System Variables section for more details.

Microsoft Identity Platform(Azure AD V2)

Microsoft identity platform is an evolution of the Azure Active Directory (Azure AD) developer platform. It allows developers to build applications that sign in all Microsoft identities and get tokens to call Microsoft APIs such as Microsoft Graph or APIs that developers have built. Microsoft Identity platform supports OAuth2 scopes, incremental consent and advanced features like multi-factor authentication and conditional access.

AWS Signature v4

AWS Signature version 4 authenticates requests to AWS services. To use it you need to set the Authorization header schema to AWS and provide your AWS credentials separated by spaces:

GET https://httpbin.org/aws-auth HTTP/1.1
Authorization: AWS <accessId> <accessKey> [token:<sessionToken>] [region:<regionName>] [service:<serviceName>]

Generate Code Snippet

코드 조각 생성 Once you’ve finalized your request in REST Client extension, you might want to make the same request from your source code. We allow you to generate snippets of code in various languages and libraries that will help you achieve this. Once you prepared a request as previously, use shortcut Ctrl+Alt+C(Cmd+Alt+C for macOS), or right-click in the editor and then select Generate Code Snippet in the menu, or press F1 and then select/type Rest Client: Generate Code Snippet, it will pop up the language pick list, as well as library list. After you selected the code snippet language/library you want, the generated code snippet will be previewed in a separate panel of Visual Studio Code, you can click the Copy Code Snippet icon in the tab title to copy it to clipboard.

HTTP Language

Visual Studio Code에서 HTTP 요청을 작성할 때 구문 강조 표시 , 자동 완성 , 코드 렌즈주석 지원 과 같은 기능을 사용하여 HTTP 요청에 대한 언어 지원을 추가합니다 . 기본적으로 언어 연결은 다음 두 가지 경우에 자동으로 활성화됩니다.

  1. 확장자가 있는 파일 .http또는.rest
  2. 파일의 첫 번째 줄은 형식 이 있는 RFC 2616 의 표준 요청 줄을 따릅니다 .Method SP Request-URI SP HTTP-Version

다른 경우에 언어 연결을 활성화하려면 오른쪽 하단의 언어 모드를 로 변경하면 Visual Studio Code됩니다 HTTP.

HTTP 언어

자동 완성

현재 다음 7개 범주에 대해 자동 완성이 활성화됩니다.

  1. HTTP 메소드
  2. 요청 기록의 HTTP URL
  3. HTTP 헤더
  4. 시스템 변수
  5. 현재 환경/파일/요청의 사용자 정의 변수
  6. AcceptContent-Type헤더 의 MIME 유형
  7. 에 대한 인증 체계 BasicDigest

요청 파일의 기호로 이동

단일 http파일은 많은 요청과 파일 수준 사용자 정의 변수를 정의할 수 있으므로 원하는 요청/변수를 찾기가 어려울 것입니다. Visual Studio Code 의 Goto Symbol 기능 을 활용 하여 바로 가기 ( macOS의 경우)로 요청/변수 탐색(goto)을 지원하거나 간단히 , 를 입력 합니다. Ctrl+Shift+OCmd+Shift+OF1@고토 기호

환경

환경은 변수를 사용하여 요청을 사용자 정의할 수 있는 기능을 제공하며 http파일의 요청을 변경하지 않고도 쉽게 환경을 전환할 수 있습니다. 일반적인 사용법은 devbox, sandbox 및 프로덕션과 같은 다양한 웹 서비스 환경에 대해 서로 다른 구성을 사용하는 것입니다. 또한 모든 환경에서 사용할 수 있는 변수 집합을 제공하기 위해 공유 환경(특수 환경 이름 $shared 로 식별됨)을 지원합니다. 그리고 지정한 환경에서 같은 이름의 변수를 정의하여 공유 환경의 값을 덮어쓸 수 있습니다. 현재 활성화된 환경의 이름은 의 오른쪽 하단에 표시되며 Visual Studio Code클릭하면 팝업 목록에서 환경을 전환할 수 있습니다. 또한 바로 가기 Ctrl+Alt+E(Cmd+Alt+EmacOS의 경우) 또는 를 누른 F1다음 를 선택/입력 Rest Client: Switch Environment합니다.

환경 및 변수를 포함하는 것은 설정 파일에 직접 정의 Visual Studio Code되어 있으므로 언제든지 환경 및 변수를 생성/업데이트/삭제할 수 있습니다. 어떤 환경도 사용 하지 않으 No Environment려면 환경 목록에서 선택할 수 있습니다 . 를 선택하면 No Environment공유 환경에 정의된 변수를 계속 사용할 수 있습니다. 환경 변수 에 대한 자세한 내용은 환경 변수를 참조 하십시오.

변수

우리는 두 가지 유형의 변수를 지원합니다. 하나는 사용자 가 정의하고 환경 변수 , 파일 변수요청 변수 로 더 나눌 수 있는 사용자 변수 이고, 다른 하나는 사전 정의된 변수 세트인 시스템 변수 입니다.

시스템 및 사용자 정의 변수 유형의 참조 구문에는 미묘한 차이가 있습니다. 전자의 경우 구문은 이고 후자의 경우 구문은 변수 이름앞에 선행하지 않고 입니다. $다양한 유형의 사용자 정의 변수에 대한 정의 구문과 위치는 다릅니다. 사용자 정의 변수에 동일한 이름을 사용하는 경우 요청 변수가 파일 변수보다 우선 순위가 높고 파일 변수가 환경 변수보다 우선 순위가 높습니다.

맞춤 변수

사용자 정의 변수는 환경 변수, 파일 변수 및 요청 변수의 이점으로 다양한 사용자 시나리오를 다룰 수 있습니다. 환경 변수는 주로 다른 환경에서 다를 수 있는 값을 저장하는 데 사용됩니다. 환경 변수는 Visual Studio Code 설정 파일에 직접 정의되어 있으므로 여러 http파일에서 참조할 수 있습니다. 파일 변수는 주로 파일 전체에서 일정한 값을 나타내는 데 사용 http됩니다. 요청 변수는 요청이 동일한 내에서 다른 요청/응답의 일부(헤더 또는 본문)를 참조해야 함을 의미하는 연결 요청 시나리오에 사용됩니다. http파일에서 로그인 응답에서 인증 토큰을 동적으로 검색해야 한다고 상상해 보세요. 요청 변수는 케이스에 잘 맞습니다. 파일 및 요청 변수는 모두 파일에 정의되며 파일 범위http 만 있습니다 .

환경 변수

환경 변수의 경우 각 환경은 설정 파일에 정의된 키 값 쌍의 집합으로 구성되며 키와 값은 각각 변수 이름과 값입니다. 선택한 환경 및 공유 환경에서 정의된 변수만 사용할 수 있습니다. ``활성 환경의 구문을 사용하여 공유 환경의 변수를 참조할 수도 있습니다. 다음은 사용자 지정 환경 및 환경 수준 변수에 대한 설정 파일의 샘플입니다.

"rest-client.environmentVariables": {
    "$shared": {
        "version": "v1",
        "prodToken": "foo",
        "nonProdToken": "bar"
    },
    "local": {
        "version": "v2",
        "host": "localhost",
        "token": "",
        "secretKey": "devSecret"
    },
    "production": {
        "host": "example.com",
        "token": "",
        "secretKey" : "prodSecret"
    }
}
http`위의 환경 변수에 대한 파일  샘플 사용법  아래에 나열되어 있습니다. *로컬* 환경으로 전환하면 *v2*`version`  되고 *프로덕션* 환경으로 변경 하면 *$shared* 환경 에서 상속되는 *v1*  됩니다.`version
GET https:///api/comments/1 HTTP/1.1
Authorization: 

파일 변수

파일 변수의 경우 정의 @variableName = variableValue는 완전한 행을 차지하는 구문을 따릅니다. 그리고 변수 이름 에는 공백이 포함 되어서는 안 됩니다 (MUST NOT ). 변수 값은 모든 문자로 구성될 수 있으며 공백도 허용됩니다(선행 및 후행 공백은 잘림). 줄 바꿈과 같은 일부 특수 문자를 유지하려면 백슬래시 \ 를 사용하여 이스케이프할 수 있습니다(예: \n. 파일 변수 값은 다른 모든 종류의 변수에 대한 참조를 포함할 수도 있습니다. 예를 들어, 와 같은 다른 요청 변수 의 값으로 파일 변수를 생성할 수 있습니다 @token = .

파일 변수는 변수 정의로만 채워진 별도의 요청 블록에서 정의할 수 있을 뿐만 아니라 변수 정의와 요청 URL 사이에 추가 공백 줄이 필요한 모든 요청 URL 앞에 요청 변수를 정의할 수 있습니다. 그러나 파일에서 파일 변수를 정의한 위치에 관계없이 http전체 파일의 모든 요청에서 참조할 수 있습니다. 파일 변수의 경우 정의 로 이동 및 모든 참조 찾기Visual Studio Code 와 같은 일부 기능 을 활용할 수도 있습니다 . 다음은 파일의 파일 변수 정의 및 참조 샘플입니다 .http

@hostname = api.example.com
@port = 8080
@host = :
@contentType = application/json
@createdAt = 
@modifiedBy = 

###

@name = hello

GET https:///authors/ HTTP/1.1

###

PATCH https:///authors/ HTTP/1.1
Content-Type: 

{
    "content": "foo bar",
    "created_at": "",
    "modified_by": ""
}

요청 변수

요청 변수는 범위 및 정의 위치와 같은 일부 측면에서 파일 변수와 유사합니다. 그러나 몇 가지 분명한 차이점이 있습니다. 요청 변수의 정의 구문은 한 줄 주석과 같 으며 원하는 요청 URL 뒤 // @name requestName또는 # @name requestName바로 앞에 있습니다. 요청 변수를 기본 요청에 이름 메타데이터 를 첨부하는 것으로 생각할 수 있으며 이러한 종류의 요청은 Named Request 로 호출 할 수 있지만 일반 요청은 Anonymous Request 로 호출할 수 있습니다 . 다른 요청에서 사용할 수 있는requestName명명된 요청 또는 최신 응답의 예상 부분을 참조하는 식별자로 사용됩니다. 명명된 요청의 응답을 참조하려면 먼저 응답을 검색하도록 명명된 요청을 수동으로 트리거해야 합니다. 그렇지 않으면 변수 참조의 일반 텍스트가 ``대신 전송됩니다.

요청 변수의 참조 구문은 다른 종류의 사용자 정의 변수보다 약간 더 복잡합니다. 요청 변수 참조 구문은 다음과 같습니다 ``. 응답 또는 요청의 두 가지 참조 부분 선택: bodyheaders 가 있습니다 . 본문 부분의 경우 전체 응답 본문을 참조하는 데 사용할 수 있고 *JSON응답 XML의 경우 JSONPathXPath 를 사용하여 특정 속성 또는 속성을 추출할 수 있습니다. 예를 들어 JSON 응답이 body 를 반환하는 경우 id를 참조하도록 {"id": "mock"}JSONPath 부분을 설정할 수 있습니다 . 헤더$.id 부분의 경우 헤더 이름을 지정하여 헤더 값을 추출할 수 있습니다. 또한 헤더 이름은대소문자를 구분하지 않습니다 .

본문 의 JSONPath 또는 XPath 또는 헤더의 헤더 이름 을 확인할 수 없는 경우 변수 참조의 일반 텍스트가 대신 전송됩니다. 그리고 이 경우 진단 정보가 표시되어 이를 검사하는 데 도움이 됩니다. 또한 요청 변수 위로 마우스를 가져가 실제 해결된 값을 볼 수도 있습니다.

다음은 파일에 있는 요청 변수 정의 및 참조의 샘플입니다 http.

@baseUrl = https://example.com/api

# @name login
POST /api/login HTTP/1.1
Content-Type: application/x-www-form-urlencoded

name=foo&password=bar

###

@authToken = 

# @name createComment
POST /comments HTTP/1.1
Authorization: 
Content-Type: application/json

{
    "content": "fake content"
}

###

@commentId = 

# @name getCreatedComment
GET /comments/ HTTP/1.1
Authorization: 

###

# @name getReplies
GET /comments//replies HTTP/1.1
Accept: application/xml

###

# @name getFirstReply
GET /comments//replies/

시스템 변수

시스템 변수는 요청(Url/Headers/Body)의 모든 부분에서 사용할 수 있는 미리 정의된 변수 집합을 형식으로 제공합니다 ``. 현재 귀하의 요청에 사용할 수 있는 몇 가지 동적 변수를 제공합니다. 변수 이름은 대소문자를 구분 합니다.

에서 지정할 수 있는 오프셋 옵션 은 다음 timestampdatetime같습니다.

옵션 설명
와이 년도
시간
에스
ms 밀리초

다음은 시스템 변수를 사용하는 예입니다.

POST https://api.example.com/comments HTTP/1.1
Content-Type: application/xml
Date: 

{
    "user_name": "",
    "request_id": "",
    "updated_at": "",
    "created_at": "",
    "review_count": "",
    "custom_date": "",
    "local_custom_date": ""
}

aadToken(Azure Active Directory 토큰) 에 대한 자세한 내용은 Wiki 에서 찾을 수 있습니다.

응답 미리보기 사용자 정의

REST 클라이언트 확장은 응답 미리보기에 사용되는 글꼴 패밀리, 크기 및 두께를 제어하는 기능을 추가합니다.

기본적으로 REST Client Extension은 미리보기 패널( status line , headersbody )에서 전체 응답만 미리 봅니다. rest-client.previewOption설정 을 통해 미리 볼 부분을 제어할 수 있습니다 .

옵션 설명
가득한 기본. 전체 응답을 미리 봅니다.
헤더 응답 헤더( 상태 표시줄 포함 )만 미리 봅니다 .
응답 본문만 미리 봅니다.
교환 전체 HTTP 교환 미리보기(요청 및 응답)

설정

Rest Client 확장은 Visual Studio Code( http.proxyhttp.proxyStrictSSL)에 대한 프록시 설정을 따릅니다. HTTP 및 HTTPS 프록시만 지원됩니다.

요청별 설정

REST 클라이언트 확장은 또한 각 독립 요청에 대한 요청 수준 설정을 지원합니다. 구문은 요청 이름 정의, # @settingName [settingValue]필수 설정 이름 및 선택적 설정 값과 유사합니다. 사용 가능한 설정은 다음과 같습니다.

이름 통사론 설명
노트 # @note 요청 확인, 특히 중요한 요청에 사용

위의 모든 선행 #은 다음으로 대체 될 수 있습니다.//

특허

MIT 라이선스

변경 로그

여기에서 CHANGELOG를 참조 하십시오.

특별한 감사

멋진 기여자 여러분 ❤️