Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Servant.API.Capture
Synopsis
- type Capture = Capture' '[]
- data Capture' (mods :: [*]) (sym :: Symbol) (a :: *)
- data CaptureAll (sym :: Symbol) (a :: *)
Documentation
Capture a value from the request path under a certain type a
.
Example:
>>>
-- GET /books/:isbn
>>>
type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book
data Capture' (mods :: [*]) (sym :: Symbol) (a :: *) #
Capture
which can be modified. For example with Description
.
data CaptureAll (sym :: Symbol) (a :: *) #
Capture all remaining values from the request path under a certain type
a
.
Example:
>>>
-- GET /src/*
>>>
type MyAPI = "src" :> CaptureAll "segments" Text :> Get '[JSON] SourceFile
Instances
(ToHttpApiData v, HasLink sub) => HasLink (CaptureAll sym v :> sub :: Type) # | |
Defined in Servant.Links Associated Types type MkLink (CaptureAll sym v :> sub) a # Methods toLink :: (Link -> a) -> Proxy (CaptureAll sym v :> sub) -> Link -> MkLink (CaptureAll sym v :> sub) a # | |
type MkLink (CaptureAll sym v :> sub :: Type) a # | |
Defined in Servant.Links |