-
Notifications
You must be signed in to change notification settings - Fork 213
Closed
Description
Others have commented that the docs are out of date, which was a problem. And they don't provide an example of how to create a bin over the API. But I believe this is the correct request:
$ curl -v -XPOST http://mockbin.org/bin/create -d '{"response": {"status": 200}}'
* Trying 104.28.23.173...
* Connected to mockbin.org (104.28.23.173) port 80 (#0)
> POST /bin/create HTTP/1.1
> Host: mockbin.org
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Length: 29
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 29 out of 29 bytes
< HTTP/1.1 500 Internal Server Error
< Date: Tue, 09 Feb 2016 10:22:13 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Set-Cookie: __cfduid=d153fa1acca9a13ee698e478446661c121455013333; expires=Wed, 08-Feb-17 10:22:13 GMT; path=/; domain=.mockbin.org; HttpOnly
< Vary: X-HTTP-Method-Override, Accept-Encoding
< X-Content-Type-Options: nosniff
< Via: 1.1 vegur
< Server: cloudflare-nginx
< CF-RAY: 271eda153b841377-LHR
<
TypeError: Cannot set property 'redirectURL' of null<br> at Bins.routes.create (/app/node_modules/mockbin/src/routes/bins.js:72:22)<br> at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:82:5)<br> at next (/app/node_modules/express/lib/router/route.js:110:13)<br> at IncomingMessage.<anonymous> (/app/node_modules/mockbin/src/middleware/body-parser.js:52:9)<br> at IncomingMessage.emit (events.js:104:17)<br> at _stream_readable.js:908:16<br> at process._tickCallback (node.js:355:11)
* Connection #0 to host mockbin.org left intact
Metadata
Metadata
Assignees
Labels
No labels