Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The HTTP/JSON plumbing used to implement the WD
monad.
These functions can be used to create your own WebDriver
instances, providing extra functionality for your application if desired. All exports
of this module are subject to change at any point.
Synopsis
- mkRequest :: (WDSessionState s, ToJSON a) => Method -> Text -> a -> s Request
- sendHTTPRequest :: WDSessionStateIO s => Request -> s (Either SomeException (Response ByteString))
- getJSONResult :: (HasCallStack, WDSessionStateControl s, FromJSON a) => Response ByteString -> s (Either SomeException a)
- handleJSONErr :: (HasCallStack, WDSessionStateControl s) => WDResponse -> s (Maybe SomeException)
- handleRespSessionId :: (HasCallStack, WDSessionStateIO s) => WDResponse -> s ()
- data WDResponse = WDResponse {}
Documentation
mkRequest :: (WDSessionState s, ToJSON a) => Method -> Text -> a -> s Request Source #
Constructs an HTTP Request
value when given a list of headers, HTTP request method, and URL fragment
sendHTTPRequest :: WDSessionStateIO s => Request -> s (Either SomeException (Response ByteString)) Source #
Sends an HTTP request to the remote WebDriver server
getJSONResult :: (HasCallStack, WDSessionStateControl s, FromJSON a) => Response ByteString -> s (Either SomeException a) Source #
Parses a WDResponse
object from a given HTTP response.
handleJSONErr :: (HasCallStack, WDSessionStateControl s) => WDResponse -> s (Maybe SomeException) Source #
handleRespSessionId :: (HasCallStack, WDSessionStateIO s) => WDResponse -> s () Source #
data WDResponse Source #
Internal type representing the JSON response object
Instances
FromJSON WDResponse Source # | |
Defined in Test.WebDriver.Internal parseJSON :: Value -> Parser WDResponse # parseJSONList :: Value -> Parser [WDResponse] # | |
Show WDResponse Source # | |
Defined in Test.WebDriver.Internal showsPrec :: Int -> WDResponse -> ShowS # show :: WDResponse -> String # showList :: [WDResponse] -> ShowS # | |
Eq WDResponse Source # | |
Defined in Test.WebDriver.Internal (==) :: WDResponse -> WDResponse -> Bool # (/=) :: WDResponse -> WDResponse -> Bool # |