ID |
---|
WSTG-FOO-003 |
To use examples of HTTP requests and responses in an article, use raw HTTP messages with the http
Markdown code block language:
```http
Place request or response capture here
```
- Try to keep the blocks small.
- Use brackets and ellipsis
[...]
to show that the message is truncated if it helps the clarity of the article.
The following section is a sample article snippet with HTTP messages and a description of the formatting.
If the tester sends the following HTTP Request for the home page:
GET / HTTP/1.1
Host: localhost:8080
Check if the response shows information about the server:
HTTP/1.1 200
[...]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Apache Tomcat/10.0.4
[...]
In this result, the response identifies the server as Tomcat 10.0.4.
- The HTTP request and response have text describing them to the reader before the request and response.
- The GET request has the smallest amount of headers to have the desired response from the server.
- For example, there is no
User-Agent:
as it is not needed for the "test case".
- For example, there is no
- The article uses brackets and ellipsis
[...]
to cut out unnecessary parts of the response.- Unnecessary response content for this sample include the
Content-Type:
header and the rest of the HTML in the body.
- Unnecessary response content for this sample include the