wreq-0.5.3.1: An easy-to-use HTTP client library.

Copyright(c) 2014 Bryan O'Sullivan
LicenseBSD-style
Maintainerbos@serpentine.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell98

Network.Wreq.Types

Contents

Description

HTTP client types.

Synopsis

Client configuration

data Options #

Options for configuring a client.

Constructors

Options 

Fields

Instances
Show Options # 
Instance details

Defined in Network.Wreq.Internal.Types

data Auth #

Supported authentication types.

Do not use HTTP authentication unless you are using TLS encryption. These authentication tokens can easily be captured and reused by an attacker if transmitted in the clear.

Constructors

BasicAuth ByteString ByteString

Basic authentication. This consists of a plain username and password.

OAuth2Bearer ByteString

An OAuth2 bearer token. This is treated by many services as the equivalent of a username and password.

OAuth2Token ByteString

A not-quite-standard OAuth2 bearer token (that seems to be used only by GitHub). This is treated by whoever accepts it as the equivalent of a username and password.

AWSAuth AWSAuthVersion ByteString ByteString (Maybe ByteString)

Amazon Web Services request signing AWSAuthVersion key secret (optional: session-token)

AWSFullAuth AWSAuthVersion ByteString ByteString (Maybe ByteString) (Maybe (ByteString, ByteString))

Amazon Web Services request signing AWSAuthVersion key secret Maybe (service, region)

OAuth1 ByteString ByteString ByteString ByteString

OAuth1 request signing OAuth1 consumerToken consumerSecret token secret

Instances
Eq Auth # 
Instance details

Defined in Network.Wreq.Internal.Types

Methods

(==) :: Auth -> Auth -> Bool #

(/=) :: Auth -> Auth -> Bool #

Show Auth # 
Instance details

Defined in Network.Wreq.Internal.Types

Methods

showsPrec :: Int -> Auth -> ShowS #

show :: Auth -> String #

showList :: [Auth] -> ShowS #

data AWSAuthVersion #

Constructors

AWSv4

AWS request signing version 4

type ResponseChecker = Request -> Response BodyReader -> IO () #

A function that checks the result of a HTTP request and potentially returns an exception.

Request payloads

data Payload where #

A product type for representing more complex payload types.

Constructors

Raw :: ContentType -> RequestBody -> Payload 
Instances
Putable Payload # 
Instance details

Defined in Network.Wreq.Types

Postable Payload # 
Instance details

Defined in Network.Wreq.Types

class Postable a where #

A type that can be converted into a POST request payload.

Minimal complete definition

Nothing

Methods

postPayload :: a -> Request -> IO Request #

postPayload :: Putable a => a -> Request -> IO Request #

Instances
Postable ByteString # 
Instance details

Defined in Network.Wreq.Types

Postable ByteString # 
Instance details

Defined in Network.Wreq.Types

Postable Encoding # 
Instance details

Defined in Network.Wreq.Types

Postable Value # 
Instance details

Defined in Network.Wreq.Types

Postable Part # 
Instance details

Defined in Network.Wreq.Types

Postable FormParam # 
Instance details

Defined in Network.Wreq.Types

Postable Payload # 
Instance details

Defined in Network.Wreq.Types

Postable [(ByteString, ByteString)] # 
Instance details

Defined in Network.Wreq.Types

Postable [Part] # 
Instance details

Defined in Network.Wreq.Types

Methods

postPayload :: [Part] -> Request -> IO Request #

Postable [FormParam] # 
Instance details

Defined in Network.Wreq.Types

Postable (ByteString, ByteString) # 
Instance details

Defined in Network.Wreq.Types

class Putable a where #

A type that can be converted into a PUT request payload.

Methods

putPayload :: a -> Request -> IO Request #

Represent a value in the request body (and perhaps the headers) of a PUT request.

Instances
Putable ByteString # 
Instance details

Defined in Network.Wreq.Types

Putable ByteString # 
Instance details

Defined in Network.Wreq.Types

Putable Encoding # 
Instance details

Defined in Network.Wreq.Types

Putable Value # 
Instance details

Defined in Network.Wreq.Types

Putable Part # 
Instance details

Defined in Network.Wreq.Types

Methods

putPayload :: Part -> Request -> IO Request #

Putable FormParam # 
Instance details

Defined in Network.Wreq.Types

Putable Payload # 
Instance details

Defined in Network.Wreq.Types

Putable [(ByteString, ByteString)] # 
Instance details

Defined in Network.Wreq.Types

Putable [Part] # 
Instance details

Defined in Network.Wreq.Types

Methods

putPayload :: [Part] -> Request -> IO Request #

Putable [FormParam] # 
Instance details

Defined in Network.Wreq.Types

Putable (ByteString, ByteString) # 
Instance details

Defined in Network.Wreq.Types

URL-encoded forms

data FormParam where #

A key/value pair for an application/x-www-form-urlencoded POST request body.

Constructors

(:=) :: FormValue v => ByteString -> v -> FormParam infixr 3 
Instances
Show FormParam # 
Instance details

Defined in Network.Wreq.Internal.Types

Putable FormParam # 
Instance details

Defined in Network.Wreq.Types

Postable FormParam # 
Instance details

Defined in Network.Wreq.Types

Putable [FormParam] # 
Instance details

Defined in Network.Wreq.Types

Postable [FormParam] # 
Instance details

Defined in Network.Wreq.Types

class FormValue a where #

A type that can be rendered as the value portion of a key/value pair for use in an application/x-www-form-urlencoded POST body. Intended for use with the FormParam type.

The instances for String, strict Text, and lazy Text are all encoded using UTF-8 before being URL-encoded.

The instance for Maybe gives an empty string on Nothing, and otherwise uses the contained type's instance.

Methods

renderFormValue :: a -> ByteString #

Render the given value.

Instances
FormValue Double # 
Instance details

Defined in Network.Wreq.Types

FormValue Float # 
Instance details

Defined in Network.Wreq.Types

FormValue Int # 
Instance details

Defined in Network.Wreq.Types

FormValue Int8 # 
Instance details

Defined in Network.Wreq.Types

FormValue Int16 # 
Instance details

Defined in Network.Wreq.Types

FormValue Int32 # 
Instance details

Defined in Network.Wreq.Types

FormValue Int64 # 
Instance details

Defined in Network.Wreq.Types

FormValue Integer # 
Instance details

Defined in Network.Wreq.Types

FormValue Word # 
Instance details

Defined in Network.Wreq.Types

FormValue Word8 # 
Instance details

Defined in Network.Wreq.Types

FormValue Word16 # 
Instance details

Defined in Network.Wreq.Types

FormValue Word32 # 
Instance details

Defined in Network.Wreq.Types

FormValue Word64 # 
Instance details

Defined in Network.Wreq.Types

FormValue () # 
Instance details

Defined in Network.Wreq.Types

Methods

renderFormValue :: () -> ByteString #

FormValue ByteString # 
Instance details

Defined in Network.Wreq.Types

FormValue ByteString # 
Instance details

Defined in Network.Wreq.Types

FormValue Builder # 
Instance details

Defined in Network.Wreq.Types

FormValue Text # 
Instance details

Defined in Network.Wreq.Types

FormValue String # 
Instance details

Defined in Network.Wreq.Types

FormValue Text # 
Instance details

Defined in Network.Wreq.Types

FormValue a => FormValue (Maybe a) # 
Instance details

Defined in Network.Wreq.Types

Headers

type ContentType = ByteString #

A MIME content type, e.g. "application/octet-stream".

data Link #

An element of a Link header.

Constructors

Link 

Errors

data JSONError #

The error type used by asJSON and asValue if a failure occurs when parsing a response body as JSON.

Constructors

JSONError String 

Request handling

data Req #

A request that is ready to be submitted.

reqURL :: Req -> ByteString #

Return the URL associated with the given Req.

This includes the port number if not standard, and the query string if one exists.

type Run body = Req -> IO (Response body) #

A function that runs a request and returns the associated response.

Orphan instances

FormValue Double # 
Instance details

FormValue Float # 
Instance details

FormValue Int # 
Instance details

FormValue Int8 # 
Instance details

FormValue Int16 # 
Instance details

FormValue Int32 # 
Instance details

FormValue Int64 # 
Instance details

FormValue Integer # 
Instance details

FormValue Word # 
Instance details

FormValue Word8 # 
Instance details

FormValue Word16 # 
Instance details

FormValue Word32 # 
Instance details

FormValue Word64 # 
Instance details

FormValue () # 
Instance details

Methods

renderFormValue :: () -> ByteString #

FormValue ByteString # 
Instance details

FormValue ByteString # 
Instance details

FormValue Builder # 
Instance details

FormValue Text # 
Instance details

FormValue String # 
Instance details

FormValue Text # 
Instance details

Putable ByteString # 
Instance details

Putable ByteString # 
Instance details

Putable Encoding # 
Instance details

Putable Value # 
Instance details

Putable Part # 
Instance details

Methods

putPayload :: Part -> Request -> IO Request #

Putable FormParam # 
Instance details

Putable Payload # 
Instance details

Postable ByteString # 
Instance details

Postable ByteString # 
Instance details

Postable Encoding # 
Instance details

Postable Value # 
Instance details

Postable Part # 
Instance details

Postable FormParam # 
Instance details

Postable Payload # 
Instance details

FormValue a => FormValue (Maybe a) # 
Instance details

Putable [(ByteString, ByteString)] # 
Instance details

Putable [Part] # 
Instance details

Methods

putPayload :: [Part] -> Request -> IO Request #

Putable [FormParam] # 
Instance details

Postable [(ByteString, ByteString)] # 
Instance details

Postable [Part] # 
Instance details

Methods

postPayload :: [Part] -> Request -> IO Request #

Postable [FormParam] # 
Instance details

Putable (ByteString, ByteString) # 
Instance details

Postable (ByteString, ByteString) # 
Instance details