This PR adds the multipart and plain (not formatted) chain to LHC basic methods.
Formats
You can use any of the basic methods in combination with a format like json:
LHC.json.get(options)
Currently supported formats: json, multipart, plain (for no formatting)
If formats are used, headers for Content-Type and Accept are set by LHC, but also http bodies are translated by LHC, so you can pass bodies as ruby objects:
LHC.json.post('http://slack', body: { text: 'Hi there' })
# Content-Type: application/json
# Accept: application/json
# Translates body to "{\"text\":\"Hi there\"}" before sending
Default format
If you use LHC's basic methods LHC.get, LHC.post etc. without any explicit format, JSON will be chosen as the default format.
Unformatted requests
In case you need to send requests without LHC formatting headers or the body, use plain:
MINOR
This PR adds the
multipart
andplain
(not formatted) chain to LHC basic methods.Formats
You can use any of the basic methods in combination with a format like
json
:Currently supported formats:
json
,multipart
,plain
(for no formatting)If formats are used, headers for
Content-Type
andAccept
are set by LHC, but also http bodies are translated by LHC, so you can pass bodies as ruby objects:Default format
If you use LHC's basic methods
LHC.get
,LHC.post
etc. without any explicit format,JSON
will be chosen as the default format.Unformatted requests
In case you need to send requests without LHC formatting headers or the body, use
plain
:Upload with LHC
If you want to upload data with LHC, it's recommended to use the
multipart
format: