Glossary

Content-Type header defined.

The Content-Type header is the line in an HTTP request that tells the server what format the body is in, so it knows how to read the bytes that follow.

Definition

How the Content-Type header works

A request body is just a stream of bytes, and those bytes could be anything: a form's fields, a JSON object, an uploaded image. The Content-Type header removes the guesswork by naming the format, using a media type like application/x-www-form-urlencoded, multipart/form-data or application/json. The server reads that header first, then picks the right parser to turn the body back into structured data.

Browsers set this header for you automatically. A plain HTML form sends application/x-www-form-urlencoded by default, and switches to multipart/form-data (with a boundary marker) the moment the form includes a file input. A fetch call, by contrast, sends whatever you tell it to, so you set the header yourself when POSTing JSON. A form backend has to accept all three, because that's what real browsers and scripts send. FormWire's endpoint reads the Content-Type on every submission, parses form-encoded, multipart and JSON bodies alike, and hands you the same clean set of fields whichever one arrived.

Related questions

Want to see it working?

Read the docs
Ready in a minute

Send any content type and let the endpoint parse it.

Free tier forever. No credit card required.