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

#Request Source

data Request

A HTTP request object

#Response Source

data Response

A HTTP response object

#RequestHeaders Source

newtype RequestHeaders

A HTTP request object


#RequestOptions Source

data RequestOptions

The type of HTTP request options

#RequestFamily Source

data RequestFamily

Values for the family request option


#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 :: Options RequestOptions -> (Response -> Effect Unit) -> Effect Request

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

#requestFromURI Source

requestFromURI :: String -> (Response -> Effect Unit) -> Effect Request

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

#requestAsStream Source

requestAsStream :: forall r. Request -> Writable r

Create a writable stream from a request object.

#responseAsStream Source

responseAsStream :: forall w. Response -> Readable w

Create a readable stream from a response object.

#setTimeout Source

setTimeout :: Request -> Int -> Effect Unit -> Effect Unit

Set the socket timeout for a Request

#httpVersion Source

httpVersion :: Response -> String

Get the request HTTP version

#responseHeaders Source

responseHeaders :: Response -> Object 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