createFetchRequest
Trigger a request below, to see the response information. (the last two image requests might fail if you are viewing this file directly from the file system, due to CORS security settings, but the examples should work when served by a webserver)
trigger request to see result
Should query a JSON API and return a post in the payload
Should query a JSON API and return a newly created post with title "foo" and body "bar" in the payload
Should query a JSON API and return a patched post with title "foo" in the payload
Should query a JSON API and delete a post, which should result in an empty payload
Should query a JSON API and return a post as unformatted text in the payload
Should query a local image and return its size in the payload
Should query a missing local image and return an error response with a null payload
Should query a JSON API, but should immediately time out
Change the behaviour of the links above, by changing what kind of fetch is getting used. Usually, "createFetchRequest" uses a ponyfilled XHR-based request, looking and behaving like a native fetch. Using the buttons below, you can define other implementation options
createJsonRequest
Trigger a request below, to see the response information. If the request injects the result into the DOM, have a look at the container below the code area to see inserted nodes.
trigger request to see result
RestfulJsonClient
Trigger a request below, to see the response information.
trigger request to see result
Should query a JSON API and return a post in the payload
Should query a JSON API and return a newly created post with title "foo" and body "bar" in the payload
Should query a JSON API and return a patched post with title "foo" in the payload
Should query a JSON API and delete a post, which should result in an empty payload
createJsRequest
Trigger a request below, to see the response information. If the request injects the result into the DOM, have a look at the container below the code area to see inserted nodes.
trigger request to see result
createCssRequest
Trigger a request below, to see the response information. If the request injects the result into the DOM, have a look at the container below the code area to see inserted nodes.
trigger request to see result
createHtmlRequest
Trigger a request below, to see the response information. If the request injects the result into the DOM, have a look at the container below the code area to see inserted nodes.
trigger request to see result
visitUrl
Trigger a request below, result should show the final URL, which was visited.