[][src]Module transistor::http

Http Client module. It contains the HttpClient for Docker and Standalone HTTP Server.

HttpClient Contains the following functions:

  • state queries endpoint / with a GET. No args.
  • tx_log requests endpoint /tx-log via POST. A Vector of types::http::Action is expected as argument.
  • tx_logs requests endpoint /tx-log via GET. No args.
  • entity requests endpoint /entity via POST. A serialized CruxId, serialized Edn::Key or a String containing a keyword must be passed as argument.
  • entity_tx requests endpoint /entity-tx via POST. A serialized CruxId, serialized Edn::Key or a String containing a keyword must be passed as argument.
  • entity_history requests endpoint /entity-history via GET. Arguments are the crux.db/id as a String, an ordering argument defined by the enum types::http::Order (Asc or Desc) and a boolean for the with-docs? flag (this returns values for the field :crux.db/doc).
  • query requests endpoint /query via POST. Argument is a query of the type Query. Retrives a Set containing a vector of the values defined by the function Query::find.

Examples can be found in the examples directory.

Structs

HttpClient

HttpClient has the reqwest::blocking::Client, the uri to query and the HeaderMap with all the possible headers. Default header is Content-Type: "application/edn". Synchronous request.