Vuforex.Signature (vuforex v0.1.1) View Source

Creates a signature based on some arguments provided. Where:

  • HTTP-Verb: This is the HTTP method used for the action, for example, GET, POST, and so forth;

  • Content-MD5: This is the hexadecimal MD5 hash of the whole request body (from the first boundary to the last one, including the boundary itself). For request types without request body, include the MD5 hash of an empty string which is ā€œd41d8cd98f00b204e9800998ecf8427eā€;

  • Content-Type: It is the content-type of the request body (like multipart/form-data). Use an empty string for request types without a request body;

  • Date: This is the current date per RFC 2616, section 3.3.1, rfc1123-date format, for example, Sun, 22 Apr 2012 08:49:37 GMT, NOTE: The date and time always refer to GMT;

  • Request-Path: This path needs to include the entire URL of the request, e.g. when updating a target the Request-Path would be "https://vws.vuforia.com/targets/{target_id}", where target_id is the specific ID of the target to be updated.

Link to this section Summary

Functions

Generates the signature based on path, body, http verb and time.

Link to this section Functions

Link to this function

generate(path, body, verb, time)

View Source

Specs

generate(String.t(), String.t() | nil, String.t(), String.t()) :: String.t()

Generates the signature based on path, body, http verb and time.

Examples

iex> Vuforex.Signature.generate("/summary", nil, "GET", "Sun, 25 Apr 2021 17:34:44 GMT")
"JLJTY+J/6O6FpXsY4t3CbGRwmOc="