Module

Yoga.HTTP.API.Route.Encoding

Package
purescript-yoga-http-api
Repository
rowtype-yoga/purescript-yoga-http-api

#JSON Source

data JSON a

JSON-encoded request body (application/json)

Example: Request { body :: JSON User }

#FormData Source

data FormData a

Form data encoded request body (application/x-www-form-urlencoded)

Example: Request { body :: FormData { username :: String, password :: String } }

#MultipartFormData Source

data MultipartFormData a

Multipart form data encoded request body (multipart/form-data)

Example: Request { body :: MultipartFormData { file :: FileUpload } }

#PlainText Source

data PlainText

Plain text request/response body (text/plain)

Example: { body :: PlainText }

#XML Source

data XML a

XML encoded request/response body (application/xml)

Example: Request { body :: XML XmlDocument }

#CustomContentType Source

data CustomContentType :: Symbol -> Type -> Typedata CustomContentType mime a

Custom content type with explicit MIME type

Example: Request { body :: CustomContentType "application/vnd.api+json" User }

#Streaming Source

data Streaming a

Streaming response body (returns a Strom of decoded chunks)

Example: { body :: Streaming Uint8Array } -- raw binary { body :: Streaming String } -- text

#NoBody Source

data NoBody

No request body (for GET, DELETE, etc.)

Example: Request {} -- NoBody is the default when body is omitted