bluzi / jsonstore

:rocket: jsonstore offers a free and secured JSON-based cloud datastore for small projects | Inactive
https://www.jsonstore.io/
MIT License
2.03k stars 74 forks source link

The Content-Type header should only be set for POST and PUT requests #6

Closed peterhellberg closed 6 years ago

peterhellberg commented 6 years ago

GET might have an Accept header though.

bluzi commented 6 years ago

Thanks, can you make a PR?

peterhellberg commented 6 years ago

Also, the server shouldn't respond with HTML for bad requests:

Example:

curl -X DELETE https://www.jsonstore.io/1ba7860f742fc15d5b6e1508e2de1e0cde2c396f7c52a877905befb4e970eaaf/xyz/abc
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Internal Server Error</pre>
</body>
</html>
peterhellberg commented 6 years ago

I generally don't work with JavaScript so I guess it would be faster for you to fix these issues :)

(I started working on a client library in Go for this service tonight, will push it to GitHub once I've got Get, Post, Put and Delete to work against www.jsonstore.io)

Edit: It seems like DELETE currently doesn't work? Second Edit: DELETE now work, but PUT doesn't for JSON values #14

bluzi commented 6 years ago

Looks like it, will have a look soon. Thanks!

bluzi commented 6 years ago

Everything here should be fixed now

peterhellberg commented 6 years ago

The GET example in the README is still misleading.

bluzi commented 6 years ago

Correct, fixed.