forked from sharkdp/bat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HTTP Request/Response syntax as a git submodule
- Loading branch information
1 parent
ffdf349
commit 6d5ff67
Showing
6 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
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
Submodule http-request-response
added at
f58bff
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
44 changes: 44 additions & 0 deletions
44
tests/syntax-tests/highlighted/http-request-response/example.http
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,44 @@ | ||
[38;2;249;38;114mPOST[0m[38;2;248;248;242m [0m[38;2;248;248;242m/[0m[38;2;248;248;242mfoo[0m[38;2;248;248;242m/[0m[38;2;248;248;242mbar[0m[38;2;248;248;242m?[0m[3;38;2;253;151;31mid[0m[38;2;249;38;114m=[0m[38;2;230;219;116m4[0m[38;2;249;38;114m&[0m[3;38;2;253;151;31mx[0m[38;2;249;38;114m=[0m[38;2;230;219;116my[0m[38;2;190;132;255m%[0m[38;2;190;132;255m20[0m[38;2;230;219;116mz[0m[38;2;248;248;242m [0m[38;2;190;132;255mHTTP/1.1[0m | ||
[38;2;249;38;114mX-Forwarded-For[0m[38;2;230;219;116m:[0m[38;2;230;219;116m 127.0.0.1[0m | ||
[38;2;249;38;114mContent-Length[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m124[0m | ||
[38;2;249;38;114mCache-Control[0m[38;2;230;219;116m:[0m[38;2;230;219;116m no-cache[0m | ||
[38;2;249;38;114mX-Forwarded-Proto[0m[38;2;230;219;116m:[0m[38;2;230;219;116m https[0m | ||
[38;2;249;38;114mContent-Type[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mapplication/json[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mcharset[0m[38;2;249;38;114m=[0m[38;2;230;219;116mutf-8[0m | ||
[38;2;249;38;114mHost[0m[38;2;230;219;116m:[0m[38;2;230;219;116m example.com[0m | ||
[38;2;249;38;114mAccept[0m[38;2;230;219;116m:[0m[38;2;230;219;116m */*[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mq[0m[38;2;249;38;114m=[0m[38;2;230;219;116m0.5[0m[38;2;230;219;116m,[0m[38;2;230;219;116m application/xml[0m | ||
[38;2;249;38;114mAccept-Encoding[0m[38;2;230;219;116m:[0m[38;2;230;219;116m gzip[0m | ||
|
||
[38;2;248;248;242m{[0m | ||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mid[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mblahblahblahblah[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m | ||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mobject[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mevent[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m | ||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mapi_version[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m2020-03-02[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m | ||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mcreated[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m1626790174[0m[38;2;248;248;242m,[0m | ||
[38;2;248;248;242m [0m[38;2;253;151;31m"[0m[38;2;253;151;31mdata[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m | ||
[38;2;248;248;242m [0m[38;2;248;248;242m}[0m | ||
[38;2;248;248;242m}[0m | ||
|
||
|
||
[38;2;190;132;255mHTTP/1.1[0m[38;2;248;248;242m [0m[38;2;190;132;255m200[0m[38;2;248;248;242m [0m[38;2;230;219;116mOK[0m | ||
[38;2;249;38;114mServer[0m[38;2;230;219;116m:[0m[38;2;230;219;116m nginx[0m | ||
[38;2;249;38;114mDate[0m[38;2;230;219;116m:[0m[38;2;230;219;116m Fri[0m[38;2;230;219;116m,[0m[38;2;230;219;116m 23 Jul 2021 10:15:12 GMT[0m | ||
[38;2;249;38;114mContent-Type[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mtext/html[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mcharset[0m[38;2;249;38;114m=[0m[38;2;230;219;116mutf-8[0m | ||
[38;2;249;38;114mTransfer-Encoding[0m[38;2;230;219;116m:[0m[38;2;230;219;116m chunked[0m | ||
[38;2;249;38;114mConnection[0m[38;2;230;219;116m:[0m[38;2;230;219;116m keep-alive[0m | ||
[38;2;249;38;114mVary[0m[38;2;230;219;116m:[0m[38;2;230;219;116m Accept-Encoding[0m | ||
[38;2;249;38;114mCache-Control[0m[38;2;230;219;116m:[0m[38;2;230;219;116m private[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mmax-age[0m[38;2;249;38;114m=[0m[38;2;190;132;255m0[0m | ||
[38;2;249;38;114mX-Frame-Options[0m[38;2;230;219;116m:[0m[38;2;230;219;116m DENY[0m | ||
[38;2;249;38;114mX-Content-Type-Options[0m[38;2;230;219;116m:[0m[38;2;230;219;116m nosniff[0m | ||
[38;2;249;38;114mX-XSS-Protection[0m[38;2;230;219;116m:[0m[38;2;230;219;116m 1[0m[38;2;230;219;116m;[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mmode[0m[38;2;249;38;114m=[0m[38;2;230;219;116mblock[0m | ||
[38;2;249;38;114mReferrer-Policy[0m[38;2;230;219;116m:[0m[38;2;230;219;116m origin[0m | ||
[38;2;249;38;114mStrict-Transport-Security[0m[38;2;230;219;116m:[0m[38;2;230;219;116m [0m[3;38;2;253;151;31mmax-age[0m[38;2;249;38;114m=[0m[38;2;190;132;255m31556900[0m | ||
|
||
[38;2;255;255;255m<![0m[38;2;249;38;114mDOCTYPE[0m[38;2;248;248;242m [0m[38;2;190;132;255mhtml[0m[38;2;255;255;255m>[0m | ||
[38;2;255;255;255m<[0m[38;2;249;38;114mhtml[0m[38;2;255;255;255m>[0m | ||
[38;2;255;255;255m<[0m[38;2;249;38;114mhead[0m[38;2;255;255;255m>[0m | ||
[38;2;248;248;242m [0m[38;2;255;255;255m<[0m[38;2;249;38;114mmeta[0m[38;2;166;226;46m [0m[38;2;166;226;46mcharset[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mutf-8[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m | ||
[38;2;248;248;242m [0m[38;2;255;255;255m<[0m[38;2;249;38;114mtitle[0m[38;2;255;255;255m>[0m[38;2;248;248;242mHello World[0m[38;2;255;255;255m</[0m[38;2;249;38;114mtitle[0m[38;2;255;255;255m>[0m | ||
[38;2;255;255;255m</[0m[38;2;249;38;114mhead[0m[38;2;255;255;255m>[0m | ||
[38;2;255;255;255m<[0m[38;2;249;38;114mbody[0m[38;2;255;255;255m>[0m | ||
|
||
[38;2;255;255;255m</[0m[38;2;249;38;114mbody[0m[38;2;255;255;255m>[0m | ||
[38;2;255;255;255m</[0m[38;2;249;38;114mhtml[0m[38;2;255;255;255m>[0m |
44 changes: 44 additions & 0 deletions
44
tests/syntax-tests/source/http-request-response/example.http
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,44 @@ | ||
POST /foo/bar?id=4&x=y%20z HTTP/1.1 | ||
X-Forwarded-For: 127.0.0.1 | ||
Content-Length: 124 | ||
Cache-Control: no-cache | ||
X-Forwarded-Proto: https | ||
Content-Type: application/json; charset=utf-8 | ||
Host: example.com | ||
Accept: */*; q=0.5, application/xml | ||
Accept-Encoding: gzip | ||
|
||
{ | ||
"id": "blahblahblahblah", | ||
"object": "event", | ||
"api_version": "2020-03-02", | ||
"created": 1626790174, | ||
"data": { | ||
} | ||
} | ||
|
||
|
||
HTTP/1.1 200 OK | ||
Server: nginx | ||
Date: Fri, 23 Jul 2021 10:15:12 GMT | ||
Content-Type: text/html; charset=utf-8 | ||
Transfer-Encoding: chunked | ||
Connection: keep-alive | ||
Vary: Accept-Encoding | ||
Cache-Control: private; max-age=0 | ||
X-Frame-Options: DENY | ||
X-Content-Type-Options: nosniff | ||
X-XSS-Protection: 1; mode=block | ||
Referrer-Policy: origin | ||
Strict-Transport-Security: max-age=31556900 | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Hello World</title> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> |