gi-soup-2.4.18: Libsoup bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Soup.Objects.Request

Contents

Description

A request to retrieve a particular URI.

Since: 2.42

Synopsis

Exported types

newtype Request Source #

Memory-managed wrapper type.

Constructors

Request (ManagedPtr Request) 
Instances
GObject Request Source # 
Instance details

Defined in GI.Soup.Objects.Request

Methods

gobjectType :: IO GType #

HasParentTypes Request Source # 
Instance details

Defined in GI.Soup.Objects.Request

type ParentTypes Request Source # 
Instance details

Defined in GI.Soup.Objects.Request

type ParentTypes Request = Object ': (Initable ': ([] :: [Type]))

class (GObject o, IsDescendantOf Request o) => IsRequest o Source #

Type class for types which can be safely cast to Request, for instance with toRequest.

Instances
(GObject o, IsDescendantOf Request o) => IsRequest o Source # 
Instance details

Defined in GI.Soup.Objects.Request

toRequest :: (MonadIO m, IsRequest o) => o -> m Request Source #

Cast to Request, for types for which this is known to be safe. For general casts, use castTo.

noRequest :: Maybe Request Source #

A convenience alias for Nothing :: Maybe Request.

Methods

getContentLength

requestGetContentLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsRequest a) 
=> a

request: a Request

-> m Int64

Returns: the length of the data represented by request, or -1 if not known.

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

request: a Request

-> m (Maybe Text)

Returns: the type of the data represented by request, or Nothing if not known.

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

requestGetSession Source #

Arguments

:: (HasCallStack, MonadIO m, IsRequest a) 
=> a

request: a Request

-> m Session

Returns: request's Session

Gets request's Session

Since: 2.42

getUri

requestGetUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsRequest a) 
=> a

request: a Request

-> m URI

Returns: request's URI

Gets request's URI

Since: 2.42

send

requestSend Source #

Arguments

:: (HasCallStack, MonadIO m, IsRequest a, IsCancellable b) 
=> a

request: a Request

-> Maybe b

cancellable: a Cancellable or Nothing

-> m InputStream

Returns: a InputStream that can be used to read from the URI pointed to by request. (Can throw GError)

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

requestSendAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsRequest a, IsCancellable b) 
=> a

request: a Request

-> Maybe b

cancellable: a Cancellable or Nothing

-> Maybe AsyncReadyCallback

callback: a 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

requestSendFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsRequest a, IsAsyncResult b) 
=> a

request: a Request

-> b

result: the AsyncResult

-> m InputStream

Returns: a InputStream that can be used to read from the URI pointed to by request. (Can throw GError)

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