Snap.Request (Snap v0.16.0)

Copy Markdown View Source

Supports making arbitrary requests against Snap.Cluster.

In most cases you're better off using the functions in Snap.Cluster directly, e.g. Snap.Cluster.get/4.

Summary

Functions

URI-encodes a single path segment using the RFC 3986 unreserved set, so a caller-supplied value (index name, document ID, metric, etc.) can't smuggle ?, #, or / into the request path.

Functions

encode_segment(segment)

@spec encode_segment(String.t() | atom() | number()) :: String.t()

URI-encodes a single path segment using the RFC 3986 unreserved set, so a caller-supplied value (index name, document ID, metric, etc.) can't smuggle ?, #, or / into the request path.

request(cluster, method, path, body \\ nil, params \\ [], headers \\ [], opts \\ [])

Makes an HTTP request against a Snap.Cluster