Idris2Doc : Stellar.HTTP.Types

Stellar.HTTP.Types

(source)
Contain all the types of requests responses and how to interact with them

Reexports

importpublic Data.Buffer
importpublic TyTTP.URL
importpublic System.Path
importpublic JSON.Simple.Derive

Definitions

WFURL : Type
  Well-formed URLs with a valid filesystem path and a list of query parameters

Visibility: public export
allowsBody : Method->Bool
Visibility: public export
DepBody : Method->Type->Type
  The body of a request depending on the request method used
TODO: remove body for HEAD , TRACE and OPTIONS

Visibility: public export
recordRichRequest : Type->Type
  A request with a well formed url and a dependent body
The fields of `RichRequest` are private the fields are accessible

Totality: total
Visibility: export
Constructor: 
MkRichReq : (method : Method) ->WFURL->Version->List (String, String) ->DepBodymethodbodyType->RichRequestbodyType

Projections:
.body : ({rec:0} : RichRequestbodyType) ->DepBody (method{rec:0}) bodyType
.headers : RichRequestbodyType->List (String, String)
.method : RichRequestbodyType->Method
.url : RichRequestbodyType->WFURL
.version : RichRequestbodyType->Version

Hints:
HasHeaders (RichRequestt)
HasMethod (RichRequestt)
HasURL (RichRequestt)
HasVersion (RichRequestt)
.getBody' : RichRequestb->Maybeb
Visibility: export
MkRichRequest : (m : Method) ->WFURL->Version->List (String, String) ->DepBodymbody->RichRequestbody
  Public constructor for `RichRequest`

Visibility: export
interfaceHasHeaders : Type->Type
  Interface for accessing headers of a request or response

Parameters: t
Methods:
.headers : t->List (String, String)

Implementations:
HasHeaders (Requestmuv (List (String, String)) b)
HasHeaders (Responsev (List (String, String)) b)
HasHeaders (RichRequestt)
.headers : HasHeaderst=>t->List (String, String)
Visibility: public export
interfaceHasVersion : Type->Type
  Interface for accessing http version of a request

Parameters: t
Methods:
.version : t->Version

Implementations:
HasVersion (RequestmuVersionhb)
HasVersion (RichRequestt)
.version : HasVersiont=>t->Version
Visibility: public export
interfaceHasMethod : Type->Type
  Interface for accessing the http method of a request

Parameters: t
Methods:
.method : t->Method

Implementations:
HasMethod (RequestMethoduvhb)
HasMethod (RichRequestt)
.method : HasMethodt=>t->Method
Visibility: public export
interfaceHasBody : Type->Type->Type
  Interface for accessing the body of a request or response

Parameters: r, t
Methods:
.body : r->t

Implementations:
HasBody (Responsevhb) b
HasBody (Requestmuvhb) b
.body : HasBodyrt=>r->t
Visibility: public export
interfaceHasURL : Type->Type
  Interface for accessing the url of a request

Parameters: t
Methods:
.url : t->WFURL

Implementations:
HasURL (RequestmWFURLvhb)
HasURL (RichRequestt)
.url : HasURLt=>t->WFURL
Visibility: public export
anyGet : (r : RichRequestt) ->allowsBody (r.method) =False=>RichRequests
  Given a rich GET request, coerce the type of its body to anything else

Visibility: export
.getBody : (r : RichRequestt) ->allowsBody (r.method) =True=>t
  Obtain the body of a rich request, requires evidence that the method is _not_ a `GET` request

Visibility: export
GenericHttpResponse : Type->Type
  The most generic kind of HTTP request using string headers

Visibility: public export
PlainRequest : Type
Visibility: public export
PlainResponse : Type
Visibility: public export
JSONRequest : Type
Visibility: public export
JSONResponse : Type
  A JSON response might not contain a response body. For this, we use Maybe.
A `Nothing` response body is an empty body

Visibility: public export
Ok : PlainResponse
Visibility: export
Bad : PlainResponse
Visibility: export
BadJSON : JSONResponse
Visibility: export
PlainHTTP : API
  The HTTP container that represents an http request and its matching http response

Visibility: public export
RichHTTP : API
  The HTTP container that represents 1 http request and its matching http response

Visibility: public export
JSONHTTP : API
  The API for requests and responses with JSON request body

Visibility: public export
URLHttpRequest : Type->Type
Visibility: public export
interfaceHTTPDebug : Type->Type
  A debug interface to avoid conflicting with `Show`.

Parameters: t
Methods:
renderDebug : t->String

Implementations:
HTTPDebugBuffer
HTTPDebugWFURL
HTTPDebug (List (String, String))
HTTPDebugJSON
HTTPDebugStatus
HTTPDebugString
renderDebug : HTTPDebugt=>t->String
Visibility: public export