Safe Haskell | None |
---|---|
Language | Haskell2010 |
PostgREST.ApiRequest
Description
- data ApiRequest = ApiRequest {
- iAction :: Action
- iRange :: HashMap ByteString NonnegRange
- iTarget :: Target
- iAccepts :: [ContentType]
- iPayload :: Maybe PayloadJSON
- iPreferRepresentation :: PreferRepresentation
- iPreferSingleObjectParameter :: Bool
- iPreferCount :: Bool
- iFilters :: [(Text, Text)]
- iLogic :: [(Text, Text)]
- iSelect :: Text
- iOrder :: [(Text, Text)]
- iCanonicalQS :: ByteString
- iJWT :: Text
- iHeaders :: [(Text, Text)]
- iCookies :: [(Text, Text)]
- data ContentType
- data Action
- data Target
- data PreferRepresentation
- = Full
- | HeadersOnly
- | None
- mutuallyAgreeable :: [ContentType] -> [ContentType] -> Maybe ContentType
- userApiRequest :: Schema -> Request -> RequestBody -> Either ApiRequestError ApiRequest
Documentation
data ApiRequest #
Describes what the user wants to do. This data type is a translation of the raw elements of an HTTP request into domain specific language. There is no guarantee that the intent is sensible, it is up to a later stage of processing to determine if it is an action we are able to perform.
Constructors
ApiRequest | |
Fields
|
data ContentType #
Enumeration of currently supported response content types
Constructors
CTApplicationJSON | |
CTTextCSV | |
CTOpenAPI | |
CTSingularJSON | |
CTOctetStream | |
CTAny | |
CTOther ByteString |
Instances
Types of things a user wants to do to tablesviewsprocs
The target db object of a user action
data PreferRepresentation #
How to return the inserted data
Constructors
Full | |
HeadersOnly | |
None |
Instances
mutuallyAgreeable :: [ContentType] -> [ContentType] -> Maybe ContentType #
Find the best match from a list of content types accepted by the client in order of decreasing preference and a list of types producible by the server. If there is no match but the client accepts */* then return the top server pick.
userApiRequest :: Schema -> Request -> RequestBody -> Either ApiRequestError ApiRequest #
Examines HTTP request and translates it into user intent.