COMPUTER ENGINEER

Blog
HTTP / HTTPS / TLS6 min study
08/ 70

Methods and request semantics

GET bodies, PUT and PATCH nuances

Framework acceptance does not imply interoperability.

UnderstandStudy an examplePractise

Understand the concept

GET request content has no generally defined semantics. Intermediaries or clients may reject or ignore it; APIs such as Fetch disallow GET/HEAD bodies. Use query parameters or an explicit POST search contract for complex searches.

PUT intends replacement of a resource representation, with server-managed fields documented. PATCH describes partial modifications. JSON Patch and JSON Merge Patch differ in formats and the meaning of null, removals and array changes.

Apply a patch atomically, not half at a time. Use ETag/If-Match for concurrent edits. Treating every operation as POST can sacrifice useful semantics and contract clarity.

WHEN TO USE IT

Build APIs that interoperate across clients and proxies.

COMMON PITFALL

Treating all JSON patch formats as equivalent.

01 / PRACTICE

One topic. Three levels of depth.

HTTP / illustrative example
GET /products?category=books HTTP/1.1
Host: example.test

A simple filter belongs in the query.

This page does not send requests to external servers. Messages are readable HTTP/1.1 illustrations, not HTTP/2 or HTTP/3 wire dumps. example.test is reserved for examples. Run commands and JavaScript only in your own test environment; never publish real tokens or cookies.

02 / YOUR TURN

Try it yourself first.

Should you filter by sending a GET body through browser Fetch?

Show the solution and explanation
Worked solution
GET query or documented POST search

No; respect client restrictions and HTTP semantics.