FIND YOUR NEXT FEW LINES

Results for “HTTP requests”

Small, practical examples. Search by task or narrow things down below.

41 snippets foundClear filters
jQueryHTTP requests

Handle an unsuccessful HTTP status

jQuery: fail receives the jqXHR object and exposes its status.

jQuery✓ Tested
jQueryHTTP requests

Attach an application-specific request header

jQuery: The headers option adds a header to this request only.

jQuery✓ Tested
jQueryHTTP requests

Cancel a pending request

jQuery: abort rejects the jqXHR with the abort status.

jQuery✓ Tested
jQueryHTTP requests

Fetch a plain-text resource

jQuery: An explicit text data type keeps the response as a string.

jQuery✓ Tested
jQueryHTTP requests

Fetch and display JSON

jQuery: getJSON parses a successful JSON response.

jQuery✓ Tested
jQueryHTTP requests

Handle a request timeout

jQuery: The timeout option bounds how long the client waits.

jQuery✓ Tested
jQueryHTTP requests

Post a JSON request body

jQuery: JSON.stringify and application/json send a JSON document.

jQuery✓ Tested
jQueryHTTP requests

Post URL-encoded form data

jQuery: post sends a data object as form-encoded fields by default.

jQuery✓ Tested
jQueryHTTP requests

Run cleanup after an AJAX failure

jQuery: always runs on success or failure and can clear loading state.

jQuery✓ Tested
jQueryHTTP requests

Send query parameters as an object

jQuery: jQuery encodes the data object into the request query.

jQuery✓ Tested
GoHTTP & URLs

Read an HTTP query parameter

Read an HTTP query parameter using a complete Go program with explicit sample inputs.

Go✓ Tested
GoHTTP & URLs

Send a JSON HTTP response

Send a JSON HTTP response using a complete Go program with explicit sample inputs.

Go✓ Tested