Behaviour for HTTP clients used by BambooHR.Client.
Implementations receive a keyword list of Req-style options assembled by
BambooHR.Client and must return {:ok, decoded_body} for 2xx responses
(where decoded_body is the JSON-decoded payload, or nil for an empty
body) or {:error, reason} otherwise. See BambooHR.Client.response/0
for the full shape.
Options passed to request/1
:method—:get,:post,:put, or:delete:url— fully-qualified URL:headers— list of{name, value}tuples (includesAuthorizationandAccept;BambooHR.ClientsetsAccept: application/jsonnormally, orAccept: */*when:raw_responseistrue, so binary downloads aren't forced into requesting a JSON representation):receive_timeout— milliseconds:params— query string parameters (optional):json— request body to JSON-encode (optional):form_multipart— request body to encode asmultipart/form-data,Req's:form_multipartshape (optional):expose_headers— whentrue, the:okpayload for a 2xx response becomes%{body: body, headers: headers}instead of the bare body.headersis a map of downcased header name to a list of values (Req's convention — a header may repeat). Defaults tofalse. Useful for endpoints that return no body and communicate their result through a header instead — e.g.POST /employees, whoseLocationheader is the only way to identify the created employee.:raw_response— whentrue, a 2xx response body is returned as-is instead of being JSON-decoded. Defaults tofalse. Required for binary downloads (e.g. file content), which are not JSON. Composes with:expose_headersto also get the response headers (e.g. to readContent-Type/Content-Dispositionfor a downloaded file).