-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from mistweaverco/feat/header-to-env
feat(parser): add env-header-key meta tag
- Loading branch information
Showing
7 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
docs/docs/usage/dynamically-setting-environment-variables-based-on-headers.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Dynamically setting environment variables based on headers | ||
|
||
You can set environment variables based on the headers of a HTTP request. | ||
|
||
Create a file with the `.http` extension and write your HTTP requests in it. | ||
|
||
## Simple example | ||
|
||
The headers of the first request can be obtained and used in the second request. | ||
The keys of the headers are all lowercase, | ||
even if they are written in uppercase or mixed-case in the request. | ||
|
||
In this example, the `content-type` and `date` headers are received in the first request. | ||
The headers received are actually `Content-Type` and `Date`, but they are converted to lowercase. | ||
|
||
```http title="simple.http" | ||
POST https://httpbin.org/post HTTP/1.1 | ||
content-type: application/json | ||
accept: application/json | ||
# @env-header-key HEADER_CONTENT_TYPE content-type | ||
# @env-header-key HEADER_DATE date | ||
{ | ||
"type": "very-simple" | ||
} | ||
### | ||
POST https://httpbin.org/post HTTP/1.1 | ||
content-type: application/json | ||
accept: application/json | ||
{ | ||
"success": true, | ||
"previous_request_header_content_type": "{{HEADER_CONTENT_TYPE}}", | ||
"previous_request_header_date": "{{HEADER_DATE}}" | ||
} | ||
``` |
2 changes: 1 addition & 1 deletion
2
.../docs/usage/dynamically-setting-environment-variables-based-on-response-json.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"name": "kulala.nvim", | ||
"version": "2.7.1" | ||
"version": "2.8.0" | ||
} |