jsonplaceholder icon indicating copy to clipboard operation
jsonplaceholder copied to clipboard

Error when posting to users - Cloudfare related it seems

Open msm1089 opened this issue 6 years ago • 0 comments

I checked for any related issue already opened, could not see any. I am trying to use the POST route https://jsonplaceholder.typicode.com/posts

EDIT: I tried all examples on the guide. Only GET requests are working atm.

HTML is sent back following the example snippet provided in the guide at https://jsonplaceholder.typicode.com/guide.html being executed in Chrome console:

Request (parsing as text, since the response was not JSON as expected)

fetch('https://jsonplaceholder.typicode.com/posts/1', {
    method: 'PATCH',
    body: JSON.stringify({
      title: 'foo'
    }),
    headers: {
      "Content-type": "application/json; charset=UTF-8"
    }
  })
  .then(response => response.text())
  .then(text => console.log(text))

// Output
{
  id: 1,
  title: 'foo',
  body: '[...]',
  userId: 1
}

Response

The relevant part...full response is below for reference.

What happened?

There is an unknown connection issue between Cloudflare and the origin web server. As a result, the web page can not be displayed.

What can I do?

If you are a visitor of this website:

Please try again in a few minutes.

If you are the owner of this website:

There is an issue between Cloudflare's cache and your origin web server. Cloudflare monitors for these errors and automatically investigates the cause. To help support the investigation, you can pull the corresponding error log from your web server and submit it our support team. Please include the Ray ID (which is at the bottom of this error page). Additional troubleshooting resources.

msm1089 avatar Aug 07 '19 16:08 msm1089