Module

Node.HTTP.Client

Package
purescript-node-http
Repository
purescript-node/purescript-node-http

This module defines low-level bindings to the Node HTTP client.

#Request Source

data Request :: Type

A HTTP request object

#Response Source

data Response :: Type

A HTTP response object

#RequestHeaders Source

newtype RequestHeaders

A HTTP request object

Constructors

#RequestOptions Source

data RequestOptions

The type of HTTP request options

#RequestFamily Source

data RequestFamily

Values for the family request option

Constructors

#protocol Source

protocol :: Option RequestOptions String

The protocol to use

#hostname Source

hostname :: Option RequestOptions String

Domain name or IP

#port Source

port :: Option RequestOptions Int

Port of remote server

#method Source

method :: Option RequestOptions String

The HTTP request method: GET, POST, etc.

#path Source

path :: Option RequestOptions String

The request path, including query string if appropriate.

#auth Source

auth :: Option RequestOptions String

Basic authentication

#cert Source

cert :: Option RequestOptions String

Public x509 certificate

#rejectUnauthorized Source

rejectUnauthorized :: Option RequestOptions Boolean

Is cert verified against CAs

#family Source

family :: Option RequestOptions RequestFamily

IP address family to use when resolving hostname. Valid values are IPV6 and IPV4

#request Source

request :: forall eff. Options RequestOptions -> (Response -> Eff (http :: HTTP | eff) Unit) -> Eff (http :: HTTP | eff) Request

Make a HTTP request using the specified options and response callback.

#requestFromURI Source

requestFromURI :: forall eff. String -> (Response -> Eff (http :: HTTP | eff) Unit) -> Eff (http :: HTTP | eff) Request

Make a HTTP request from a URI string and response callback.

#requestAsStream Source

requestAsStream :: forall r eff. Request -> Writable r (http :: HTTP | eff)

Create a writable stream from a request object.

#responseAsStream Source

responseAsStream :: forall w eff. Response -> Readable w (http :: HTTP | eff)

Create a readable stream from a response object.

#setTimeout Source

setTimeout :: forall eff. Request -> Int -> Eff (http :: HTTP | eff) Unit -> Eff (http :: HTTP | eff) Unit

Set the socket timeout for a Request

#httpVersion Source

httpVersion :: Response -> String

Get the request HTTP version

#responseHeaders Source

responseHeaders :: Response -> StrMap String

Get the response headers as a hash Cookies are not included and could be retrieved with responseCookies

#responseCookies Source

responseCookies :: Response -> Maybe (Array String)

Get the response cookies as Just (Array String) or Nothing if no cookies

#statusCode Source

statusCode :: Response -> Int

Get the response status code

#statusMessage Source

statusMessage :: Response -> String

Get the response status message