Results for “HTTP & URLs”
Small, practical examples. Search by task or narrow things down below.
Fetch a plain-text resource
jQuery: An explicit text data type keeps the response as a string.
jQuery✓ Tested
Fetch and display JSON
jQuery: getJSON parses a successful JSON response.
jQuery✓ Tested
Handle a request timeout
jQuery: The timeout option bounds how long the client waits.
jQuery✓ Tested
Post a JSON request body
jQuery: JSON.stringify and application/json send a JSON document.
jQuery✓ Tested
Post URL-encoded form data
jQuery: post sends a data object as form-encoded fields by default.
jQuery✓ Tested
Run cleanup after an AJAX failure
jQuery: always runs on success or failure and can clear loading state.
jQuery✓ Tested
Send query parameters as an object
jQuery: jQuery encodes the data object into the request query.
jQuery✓ Tested
Build a URL query string from values
JavaScript: URLSearchParams handles query escaping and repeated parameter appends.
JavaScript✓ Tested
Build a URL query string from values
TypeScript: URLSearchParams handles query escaping and repeated parameter appends.
TypeScript✓ Tested
Resolve relative links against an explicit base
HTML: A base href changes how relative document URLs are resolved.
HTML✓ Tested