smallex v0.0.7 Json
JSON API calllibrary (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 \\ [], map_function \\ &nop/1)
Delete JSON API (header & map_function are optional)
Examples
iex> Json.delete( "https://httpbin.org", "/delete?param1=value1" )[ "args" ]
%{"param1" => "value1"}
Link to this function
get(domain, path, header \\ [], map_function \\ &nop/1)
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", "/", [] ).status_code
200
Link to this function
patch(domain, path, body, header \\ [], map_function \\ &nop/1)
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 \\ [], map_function \\ &nop/1)
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 \\ [], map_function \\ &nop/1)
Put JSON API (header & map_function are optional)
Examples
iex> Json.put( "https://httpbin.org", "/put?param1=value1", "{ data1:value1 }" )[ "args" ]
%{"param1" => "value1"}