| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Soup.Objects.Request
Contents
Description
A request to retrieve a particular URI.
Since: 2.42
Synopsis
- newtype Request = Request (ManagedPtr Request)
- class (GObject o, IsDescendantOf Request o) => IsRequest o
- toRequest :: (MonadIO m, IsRequest o) => o -> m Request
- noRequest :: Maybe Request
- requestGetContentLength :: (HasCallStack, MonadIO m, IsRequest a) => a -> m Int64
- requestGetContentType :: (HasCallStack, MonadIO m, IsRequest a) => a -> m (Maybe Text)
- requestGetSession :: (HasCallStack, MonadIO m, IsRequest a) => a -> m Session
- requestGetUri :: (HasCallStack, MonadIO m, IsRequest a) => a -> m URI
- requestSend :: (HasCallStack, MonadIO m, IsRequest a, IsCancellable b) => a -> Maybe b -> m InputStream
- requestSendAsync :: (HasCallStack, MonadIO m, IsRequest a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- requestSendFinish :: (HasCallStack, MonadIO m, IsRequest a, IsAsyncResult b) => a -> b -> m InputStream
- constructRequestSession :: (IsRequest o, IsSession a) => a -> IO (GValueConstruct o)
- getRequestSession :: (MonadIO m, IsRequest o) => o -> m Session
- constructRequestUri :: IsRequest o => URI -> IO (GValueConstruct o)
- getRequestUri :: (MonadIO m, IsRequest o) => o -> m URI
Exported types
Memory-managed wrapper type.
Constructors
| Request (ManagedPtr Request) |
Instances
| GObject Request Source # | |
Defined in GI.Soup.Objects.Request Methods gobjectType :: IO GType # | |
| HasParentTypes Request Source # | |
Defined in GI.Soup.Objects.Request | |
| type ParentTypes Request Source # | |
Defined in GI.Soup.Objects.Request | |
class (GObject o, IsDescendantOf Request o) => IsRequest o Source #
Instances
| (GObject o, IsDescendantOf Request o) => IsRequest o Source # | |
Defined in GI.Soup.Objects.Request | |
Methods
getContentLength
requestGetContentLength Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRequest a) | |
| => a |
|
| -> m Int64 | Returns: the length of the data represented by |
Gets the length of the data represented by request. For most
request types, this will not be known until after you call
requestSend or requestSendFinish.
Since: 2.42
getContentType
requestGetContentType Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRequest a) | |
| => a |
|
| -> m (Maybe Text) | Returns: the type of the data represented by
|
Gets the type of the data represented by request. For most request
types, this will not be known until after you call
requestSend or requestSendFinish.
As in the HTTP Content-Type header, this may include parameters after the MIME type.
Since: 2.42
getSession
Arguments
| :: (HasCallStack, MonadIO m, IsRequest a) | |
| => a |
|
| -> m Session | Returns: |
Gets request's Session
Since: 2.42
getUri
Arguments
| :: (HasCallStack, MonadIO m, IsRequest a) | |
| => a |
|
| -> m URI | Returns: |
Gets request's URI
Since: 2.42
send
Arguments
| :: (HasCallStack, MonadIO m, IsRequest a, IsCancellable b) | |
| => a |
|
| -> Maybe b |
|
| -> m InputStream | Returns: a |
Synchronously requests the URI pointed to by request, and returns
a InputStream that can be used to read its contents.
Note that you cannot use this method with SoupRequests attached to
a SessionAsync.
Since: 2.42
sendAsync
Arguments
| :: (HasCallStack, MonadIO m, IsRequest a, IsCancellable b) | |
| => a |
|
| -> Maybe b |
|
| -> Maybe AsyncReadyCallback |
|
| -> m () |
Begins an asynchronously request for the URI pointed to by
request.
Note that you cannot use this method with SoupRequests attached to
a SessionSync.
Since: 2.42
sendFinish
Arguments
| :: (HasCallStack, MonadIO m, IsRequest a, IsAsyncResult b) | |
| => a |
|
| -> b |
|
| -> m InputStream | Returns: a |
Gets the result of a requestSendAsync.
Since: 2.42
Properties
session
The request's Session.
Since: 2.42
constructRequestSession :: (IsRequest o, IsSession a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “session” property. This is rarely needed directly, but it is used by new.
getRequestSession :: (MonadIO m, IsRequest o) => o -> m Session Source #
Get the value of the “session” property.
When overloading is enabled, this is equivalent to
get request #session
uri
The request URI.
Since: 2.42
constructRequestUri :: IsRequest o => URI -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “uri” property. This is rarely needed directly, but it is used by new.
getRequestUri :: (MonadIO m, IsRequest o) => o -> m URI Source #
Get the value of the “uri” property.
When overloading is enabled, this is equivalent to
get request #uri