----网站地址------ https://httpbin.org/
DESCRIPTION
Testing an HTTP Library can become difficult sometimes.RequestBin is fantastic
for testing POST requests, but doesn't let you control the response.This exists
to cover all kinds of HTTP scenarios. Additional endpoints are being considered.
一 使用条件:
1 有一定的网络基础知识,
2 能够明白网址,请求等基础术语
3 能够自己拼接网络地址
4 明白网址结构构成
5 有至少一种编程语言基础
二 使用情景:
1 当你需要急需一个网址进行get/post等请求方法的测试的时候
2 获取本机原始ip
3 获取UUID4
4 获取本次网络请求的user-agent
三 使用方法: https://httpbin.org/ �按照网站的内容后边直接拼接对应的路径
四 部分内容截图
例如:
1 GET请求:
1.1 访问地址:https://httpbin.org/get
1.2 请求方法: GET
1.3 返回内容:
{
"args": {},
"headers": {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
"Connection": "close",
"Cookie": "_gauges_unique_year=1; _gauges_unique=1; _gauges_unique_hour=1; _gauges_unique_day=1; _gauges_unique_month=1",
"Host": "httpbin.org",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
},
"origin": "111.206.175.44",
"url": "https://httpbin.org/get"
}
2 POST请求
2.1 访问地址:https://httpbin.org/post
2.2 请求方法: POST
当然还有很多请求,详见附录:
/
This page.-
Returns Origin IP.
-
Returns UUID4.
-
Returns user-agent.
-
Returns header dict.
-
Returns GET data.
-
/post
Returns POST data.
-
/patch
Returns PATCH data.
-
/put
Returns PUT data.
-
/delete
Returns DELETE data
-
Returns request data, including method used.
-
/anything/:anything
Returns request data, including the URL.
-
Returns page containing UTF-8 data.
-
Returns gzip-encoded data.
-
Returns deflate-encoded data.
-
Returns brotli-encoded data.
-
Returns given HTTP Status code.
-
Returns given response headers.
-
302 Redirects
n
times.
-
302 Redirects to the
foo
URL.
-
/redirect-to?url=foo&status_code=307
307 Redirects to the
foo
URL.
-
302 Relative redirects
n
times.
-
302 Absolute redirects
n
times.
-
Returns cookie data.
-
Sets one or more simple cookies.
-
Deletes one or more simple cookies.
-
Challenges HTTPBasic Auth.
-
/hidden-basic-auth/:user/:passwd
404'd BasicAuth.
-
/digest-auth/:qop/:user/:passwd/:algorithm
Challenges HTTP Digest Auth.
-
/digest-auth/:qop/:user/:passwd
Challenges HTTP Digest Auth.
-
Streams
min(n, 100)
lines.
-
Delays responding for
min(n, 10)
seconds.
-
/drip?numbytes=n&duration=s&delay=s&code=code
Drips data over a duration after an optional initial delay, then (optionally) returns with the given status code.
-
/range/1024?duration=s&chunk_size=code
Streams
n
bytes, and allows specifying a
Range
header to select a subset of the data. Accepts a
chunk_size
and request
durationparameter.
-
Renders an HTML Page.
-
Returns some robots.txt rules.
-
Denied by robots.txt file.
-
Returns 200 unless an If-Modified-Since or If-None-Match header is provided, when it returns a 304.
-
Assumes the resource has the given etag and responds to If-None-Match header with a 200 or 304 and If-Match with a 200 or 412 as appropriate.
-
Sets a Cache-Control header for
n
seconds.
-
Generates
n
random bytes of binary data, accepts optional
seed
integer parameter.
-
Streams
n
random bytes of binary data in chunked encoding, accepts optional
seed
and
chunk_sizeinteger parameters.
-
Returns page containing
n
HTML links.
-
Returns page containing an image based on sent Accept header.
-
Returns a PNG image.
-
Returns a JPEG image.
-
Returns a WEBP image.
-
Returns a SVG image.
-
HTML form that submits to
/post
-
Returns some XML