Skip to content

Simplest bin create failing #43

@philwinder

Description

@philwinder

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 &#39;redirectURL&#39; of null<br> &nbsp; &nbsp;at Bins.routes.create (/app/node_modules/mockbin/src/routes/bins.js:72:22)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:82:5)<br> &nbsp; &nbsp;at next (/app/node_modules/express/lib/router/route.js:110:13)<br> &nbsp; &nbsp;at IncomingMessage.&lt;anonymous&gt; (/app/node_modules/mockbin/src/middleware/body-parser.js:52:9)<br> &nbsp; &nbsp;at IncomingMessage.emit (events.js:104:17)<br> &nbsp; &nbsp;at _stream_readable.js:908:16<br> &nbsp; &nbsp;at process._tickCallback (node.js:355:11)
* Connection #0 to host mockbin.org left intact

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions