Skip to content

ContentType

Tambapps edited this page Nov 9, 2021 · 5 revisions

This library is based on ContentTypes to automatize composing/parsing. You can find the class ContentType holding the value of its corresponding header.

Request body composing

When composing a request body, the poet will find a composer for the ContentType provided and use it to compose the request body. If no composer were found, it will use the string representation of the object passed.

Response body parsing

When parsing a response body, the poet will find a parser for the given ContentType header of the response and use it to parse the response data. If no parser were found, it will return the response body as a String.

Of course, you can set and update composers/parser, as seen in Composers and Parsers sections.

Clone this wiki locally