所以我 fork 了 mccutchen/go-httpbin 项目,并添加了一些特性。 add -response-delay args (more observability, except /delay/{time} api) pretty response json (more like httpbin) add query param envs (identify httpbin instance, default show HOSTNAME for k8s. eg: curl http://localhost:8080/get?
metadata: labels: app: httpbin-deployment spec: containers: - name: httpbin-deployment image: kennethreitz/httpbin:latest imagePullPolicy: IfNotPresent ports: - name: http containerPort: 80 protocol: TCP resources: {} livenessProbe: tcpSocket: port: 80 initialDelaySeconds: 2 timeoutSeconds: 2 ...
httpbin 还提供了一系列常用接口,包括:/get、/put、/post、/patch、/status/{codes}、/ip、/delay/{delay} 等。这些接口允许测试各种 HTTP 场景。然而,httpbin 的 GitHub 项目在 2018 年后停止更新,存在一些需求和 Bug 未解决。因此,作者fork了一个名为 go-httpbin 的项目,该服务仅使用 Go ...
如果一个人想学习爬虫技术,我会首先推荐他学会使用httpbin! httpbin(官网|github)是一个很不错测试工具,你可以放心大胆的黑他,而不用担心他报复你。他有点像一个蜜罐,时刻等待着你的光临,然后根据你的请求,给你返回你想要的东西 相同推荐 类似这种能够很方便调试接口的还有很多,但是无疑还是httpbin最好用。 reques...
0.4.1: Added floating-point support for /delay endpoint 0.4.0: New /image/svg endpoint, add deploy to heroku button, add 406 response to /image, and don't always emit the transfer-encoding header for stream endpoint. 0.3.0: A number of new features, including a /range endpoint, lots ...
/delay/:n***Delays responding forn– 10 seconds. /drip***Drips data over a duration after an optional initial delay, then (optionally) returns with the givenstatus code. /range/:n***Streamsnbytes, and allows specifying aRangeheader to select a subset of the data. Accepts achunk_sizeand...
return responsedelay = float(args.get("delay", 0)) if delay > 0: time.sleep(delay)pause = duration / numbytesdef generate_bytes(): for i in xrange(numbytes): yield b"*" time.sleep(pause)response = Response( generate_bytes(), headers={ "Content-Type": "application/octet-stream", ...
/delay/:n - Delays responding for min(n, 10) seconds. /delete - Returns request data. Allows only DELETE requests. /forms/post - HTML form that submits to /post. /get - Returns request data. Allows only GET requests. /head - Returns request data. Allows only HEAD requests. /headers...
curl -G "https://httpbin.org/delay/5" --max-time 2 curl: (28) Operation timed out after 2001 milliseconds with 0 bytes received Qiita Conference is the largest tech conference in Qiita! Keynote Speaker Takahiro Anno, Masaki Fujimoto, Yukihiro Matsumoto(Matz)...
HTTP库的测试一般来说较为繁琐,一些同学较为熟悉的RequestBin虽然好用,但只能测试POST,且无法控制其response。HTTPBin是以Python+Flask写的一款工具,它cover了各类的HTTP场景,且每个接口一定都有返回。 安装方法 使用pip工具分别安装httpbin与guicorn,guicorn是一个wsgi http服务器,详见guicorn 是什么。