smallex v0.2.3 Json

JSON API call library (with parse support).

Link to this section Summary

Functions

Delete JSON API (header & map_function are optional)

Get JSON API (header & map_function are optional)

Head JSON API (header & map_function are optional)

Patch JSON API (header & map_function are optional)

Post JSON API (header & map_function are optional)

Put JSON API (header & map_function are optional)

Link to this section Functions

Link to this function delete(domain, path, header \\ [])

Delete JSON API (header & map_function are optional)

Examples

iex> ( Json.delete( "https://httpbin.org", "/delete?param1=value1" ) |> Poison.decode! )[ "args" ]
%{"param1" => "value1"}
Link to this function get(domain, path, header \\ [])

Get JSON API (header & map_function are optional)

Examples

iex> Json.get( "https://api.github.com", "/rate_limit" )[ "rate" ][ "limit" ]
60
Link to this function head(domain, path, header \\ [])

Head JSON API (header & map_function are optional)

Examples

iex> Json.head( "https://httpbin.org", "/", [] )
""
Link to this function patch(domain, path, body, header \\ [])

Patch JSON API (header & map_function are optional)

Examples

iex> Json.patch( "https://httpbin.org", "/patch?param1=value1", "{ data1:value1 }" )[ "args" ]
%{"param1" => "value1"}
Link to this function post(domain, path, body, header \\ [])

Post JSON API (header & map_function are optional)

Examples

iex> Json.post( "https://httpbin.org", "/post?param1=value1", "{ data1:value1 }" )[ "args" ]
%{"param1" => "value1"}

iex> Json.post( "https://httpbin.org", "/post?param1=value1", "{ data1:value1 }" )[ "data" ]
"{ data1:value1 }"
Link to this function put(domain, path, body, header \\ [])

Put JSON API (header & map_function are optional)

Examples

iex> Json.put( "https://httpbin.org", "/put?param1=value1", "{ data1:value1 }" )[ "args" ]
%{"param1" => "value1"}