logic_monitor v0.0.7 LogicMonitor.Request

Provides the base request function and helper functions for GET and POST. Requests are authenticated using LMv1 Authentication as described here. All request functions return either {:ok, {status, data}} or {:error, reason}

Summary

Functions

Sends a GET request to the specified resource_path with the specified query_params. Sends multiple requests if negative total is returned (indicating more resources available)

Sends a POST request to the specified resource_path with the specified query_params (as a string in the form “key1=val1&key2=val2”) and the specified payload

Sends a request using the specified method to the specified resource_path with the specified query_params (as a string in the form “key1=val1&key2=val2”) and the specified payload

Types

request_response ::
  {:ok, {any, any}} |
  {:error, any}

Functions

get(resource_path, query_params)

Sends a GET request to the specified resource_path with the specified query_params. Sends multiple requests if negative total is returned (indicating more resources available)

get_auth(method, resource_path)
post(resource_path, query_params, payload)

Sends a POST request to the specified resource_path with the specified query_params (as a string in the form “key1=val1&key2=val2”) and the specified payload.

request(method, resource_path, query_params, payload)

Sends a request using the specified method to the specified resource_path with the specified query_params (as a string in the form “key1=val1&key2=val2”) and the specified payload.