Skip to content

Commit c7a5340

Browse files
committed
update snippet docs for use of extra options
1 parent 7f9f50f commit c7a5340

17 files changed

+12
-24
lines changed

docs/http_snippets/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
## Install
55

6+
> Waiting for a PR to be merged: https://github.com/Kong/httpsnippet/pull/222
7+
>
8+
> Otherwise, extra options cannot be passed
9+
> (you'll need to delete Host and Content-Length manually, or use the forked version)
10+
611
```shell
712
# to use in cli
813
npm install --global httpsnippet
@@ -56,6 +61,12 @@ httpsnippet minimal_api__create_person.json --target http --output ./snippets
5661
```
5762

5863

64+
```shell
65+
# minimal api to http. don't write Host, Content-Length
66+
httpsnippet minimal_api__create_person.json --target http --output ./snippets -x '{"autoHost": false, "autoContentLength": false}'
67+
```
68+
69+
5970
```shell
6071
# process multiple
6172
httpsnippet ./*.json --target http --output ./snippets

docs/http_snippets/run_and_create.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ echo "Create HTTP and Python snippets"
44

55
for filename in ./"$1"*.json; do
66
echo "process $filename"
7-
httpsnippet "$filename" --target http --output ./snippets
7+
httpsnippet "$filename" --target http --output ./snippets -x '{"autoHost": false, "autoContentLength": false}'
88
httpsnippet "$filename" --target python --client requests --output ./snippets
99
done
1010

docs/http_snippets/snippets/minimal_api__create_person

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
POST /persons HTTP/1.1
22
Content-Type: application/vnd.api+json
3-
Host: localhost:5000
4-
Content-Length: 90
53

64
{
75
"data": {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
DELETE /persons/1 HTTP/1.1
22
Content-Type: application/vnd.api+json
3-
Host: localhost:5000
43

54

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
GET /persons/1 HTTP/1.1
22
Content-Type: application/vnd.api+json
3-
Host: localhost:5000
43

54

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
GET /persons HTTP/1.1
22
Content-Type: application/vnd.api+json
3-
Host: localhost:5000
43

54

docs/http_snippets/snippets/minimal_api__patch_person

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
PATCH /persons/1 HTTP/1.1
22
Content-Type: application/vnd.api+json
3-
Host: localhost:5000
4-
Content-Length: 102
53

64
{
75
"data": {

docs/http_snippets/snippets/relationship_api__create_computer

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
POST /computers HTTP/1.1
22
Content-Type: application/vnd.api+json
3-
Host: localhost:5000
4-
Content-Length: 95
53

64
{
75
"data": {

docs/http_snippets/snippets/relationship_api__create_computer_relationship_for_person

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
POST /persons/1/relationships/computers HTTP/1.1
22
Content-Type: application/vnd.api+json
3-
Host: localhost:5000
4-
Content-Length: 73
53

64
{
75
"data": [

docs/http_snippets/snippets/relationship_api__create_person_with_computer_relationship

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
POST /persons?include=computers HTTP/1.1
22
Content-Type: application/vnd.api+json
3-
Host: localhost:5000
4-
Content-Length: 287
53

64
{
75
"data": {

0 commit comments

Comments
 (0)