Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data RawQueryString
Documentation
data RawQueryString Source #
RawQueryString
gives handler authors a combinator to access the raw
(that is, un-parsed) query string from the WAI request, as a
ByteString.
Generally speaking, you should prefer to use the QueryString
combinator, but if you need access to the raw value, this combinator
provides it.
Example:
import Control.Monad.IO.Class (liftIO) import Servant import ServantExtras.RawQueryString import qualified Network.HTTP.Types.Header as NTH (Header) type MyAPI = "my-query-endpoint" :> RawQueryString :> Get '[JSON] NoContent myServer :: Server MyAPI myServer = queryEndpointHandler where queryEndpointHandler :: ByteString -> Handler NoContent queryEndpointHandler queryStr = -- do something with the ByteString, like pass it to a -- sub-process
Instances
HasServer api ctx => HasServer (RawQueryString :> api :: Type) ctx Source # | |
Defined in Servant.API.RawQueryString type ServerT (RawQueryString :> api) m # route :: Proxy (RawQueryString :> api) -> Context ctx -> Delayed env (Server (RawQueryString :> api)) -> Router env # hoistServerWithContext :: Proxy (RawQueryString :> api) -> Proxy ctx -> (forall x. m x -> n x) -> ServerT (RawQueryString :> api) m -> ServerT (RawQueryString :> api) n # | |
type ServerT (RawQueryString :> api :: Type) m Source # | |
Defined in Servant.API.RawQueryString |