-
Notifications
You must be signed in to change notification settings - Fork 0
Dot Http Files
Heath Brown edited this page Jun 15, 2024
·
1 revision
IDEs sometimes will support .http type files, such as, VSCode. Then with an extension these files can be read and executed via a REST client or http client.
If using Visual Studio Code, the extension is called Rest Client .
POST https://example.com/comments HTTP/1.1
content-type: application/json
{
"name": "sample",
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
POST https://example.com/comments HTTP/1.1
content-type: application/json
{
"name": "sample",
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
###
POST https://example.com/comments HTTP/1.1
content-type: application/json
{
"name": "sample",
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
POST https://example.com/comments HTTP/1.1
content-type: application/json
Authorization: {{$token}}
{
"name": "sample",
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
###
POST https://example.com/comments HTTP/1.1
content-type: application/json
Authorization: {{$token}}
{
"name": "sample",
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
"rest-client.environmentVariables": { "$shared": { "version": "v1", "prodToken": "foo", "nonProdToken": "bar" }, "local": { "version": "v2", "host": "localhost", "token": "{{$shared nonProdToken}}", "secretKey": "devSecret" }, "production": { "host": "example.com", "token": "{{$shared prodToken}}", "secretKey" : "prodSecret" } }