-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #710 from Golmote/tests-http
Add tests for HTTP
- Loading branch information
Showing
5 changed files
with
155 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 | ||
Accept-Encoding: gzip, deflate | ||
Server: GitHub.com | ||
Date: Mon, 22 Dec 2014 18:25:30 GMT | ||
Content-Type: text/html; charset=utf-8 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["header-name", "Accept-Language:"], | ||
" fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3\r\n", | ||
["header-name", "Accept-Encoding:"], | ||
" gzip, deflate\r\n", | ||
["header-name", "Server:"], | ||
" GitHub.com\r\n", | ||
["header-name", "Date:"], | ||
" Mon, 22 Dec 2014 18:25:30 GMT\r\n", | ||
["header-name", "Content-Type:"], | ||
" text/html; charset=utf-8" | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for header names. |
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,51 @@ | ||
POST http://example.com HTTP/1.0 | ||
GET http://localhost:9999/foo.html HTTP/1.1 | ||
PUT http://www.example.com HTTP/2.0 | ||
DELETE https://example.com HTTP/1.1 | ||
OPTIONS https://www.example.com HTTP/1.1 | ||
PATCH http://example.com HTTP/1.0 | ||
TRACE http://example.com HTTP/1.0 | ||
CONNECT http://example.com HTTP/1.0 | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["request-line", [ | ||
["property", "POST"], | ||
" http://example.com HTTP/1.0" | ||
]], | ||
["request-line", [ | ||
["property", "GET"], | ||
" http://localhost", | ||
["attr-name", ":9999"], | ||
"/foo.html HTTP/1.1" | ||
]], | ||
["request-line", [ | ||
["property", "PUT"], | ||
" http://www.example.com HTTP/2.0" | ||
]], | ||
["request-line", [ | ||
["property", "DELETE"], | ||
" https://example.com HTTP/1.1" | ||
]], | ||
["request-line", [ | ||
["property", "OPTIONS"], | ||
" https://www.example.com HTTP/1.1" | ||
]], | ||
["request-line", [ | ||
["property", "PATCH"], | ||
" http://example.com HTTP/1.0" | ||
]], | ||
["request-line", [ | ||
["property", "TRACE"], | ||
" http://example.com HTTP/1.0" | ||
]], | ||
["request-line", [ | ||
["property", "CONNECT"], | ||
" http://example.com HTTP/1.0" | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for request lines. |
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,29 @@ | ||
HTTP/1.0 200 OK | ||
HTTP/1.1 403 Forbidden | ||
HTTP/1.1 404 Not Found | ||
HTTP/1.0 418 I'm a teapot | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["response-status", [ | ||
"HTTP/1.0 ", | ||
["property", "200 OK"] | ||
]], | ||
["response-status", [ | ||
"HTTP/1.1 ", | ||
["property", "403 Forbidden"] | ||
]], | ||
["response-status", [ | ||
"HTTP/1.1 ", | ||
["property", "404 Not Found"] | ||
]], | ||
["response-status", [ | ||
"HTTP/1.0 ", | ||
["property", "418 I'm a teapot"] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for response statuses. |
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,21 @@ | ||
Content-type: application/json | ||
|
||
{"foo":"bar"} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["header-name", "Content-type:"], | ||
" application/json", | ||
["application/json", [ | ||
["punctuation", "{"], | ||
["string", "\"foo\""], | ||
["punctuation", ":"], | ||
["string", "\"bar\""], | ||
["punctuation", "}"] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for JSON content in 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,30 @@ | ||
Content-type: application/xml | ||
|
||
<foo></foo> | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["header-name", "Content-type:"], | ||
" application/xml", | ||
["application/xml", [ | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "<"], | ||
"foo" | ||
]], | ||
["punctuation", ">"] | ||
]], | ||
["tag", [ | ||
["tag", [ | ||
["punctuation", "</"], | ||
"foo" | ||
]], | ||
["punctuation", ">"] | ||
]] | ||
]] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for XML content in HTTP. |