@shopify/network
v3.3.0
Published
Common values related to dealing with the network
Downloads
589,658
Keywords
Readme
@shopify/network
Common values related to dealing with the network.
Installation
yarn add @shopify/network
Usage
Import any of the enums or functions in this package to get a friendly API to common network details. The following values are exposed from this library:
Method
: enum for HTTP methodsStatusCode
: enum for HTTP status codes (mapping from name to number)ResponseType
: response type enum (2xx, 3xx, etc)Header
: enum for common header namesCspDirective
: enum for names of content security policy directivesCspSandboxAllow
: enum for values allowed in the CSPsandbox
directiveSpecialSource
: enum for "special" (non-URI) sources usable in many CSP directivesnonceSource()
: function for generating nonce sources in CSP directivesgetResponseType
: returns theResponseType
for an HTTP status codeHashAlgorithm
: enum for hash algorithms usable in several CSP directiveshashSource()
: function for generating hash sources in CSP directives