| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Soup.Structs.Multipart
Description
Represents a multipart HTTP message body, parsed according to the syntax of RFC 2046. Of particular interest to HTTP are <literal>multipart/byte-ranges</literal> and <literal>multipart/form-data</literal>.
Although the headers of a Multipart body part will contain the
full headers from that body part, libsoup does not interpret them
according to MIME rules. For example, each body part is assumed to
have "binary" Content-Transfer-Encoding, even if its headers
explicitly state otherwise. In other words, don't try to use
Multipart for handling real MIME multiparts.
Since: 2.26
Synopsis
- newtype Multipart = Multipart (ManagedPtr Multipart)
- multipartAppendFormFile :: (HasCallStack, MonadIO m) => Multipart -> Text -> Text -> Text -> Buffer -> m ()
- multipartAppendFormString :: (HasCallStack, MonadIO m) => Multipart -> Text -> Text -> m ()
- multipartAppendPart :: (HasCallStack, MonadIO m) => Multipart -> MessageHeaders -> Buffer -> m ()
- multipartFree :: (HasCallStack, MonadIO m) => Multipart -> m ()
- multipartGetLength :: (HasCallStack, MonadIO m) => Multipart -> m Int32
- multipartGetPart :: (HasCallStack, MonadIO m) => Multipart -> Int32 -> m (Bool, MessageHeaders, Buffer)
- multipartNew :: (HasCallStack, MonadIO m) => Text -> m Multipart
- multipartNewFromMessage :: (HasCallStack, MonadIO m) => MessageHeaders -> MessageBody -> m (Maybe Multipart)
- multipartToMessage :: (HasCallStack, MonadIO m) => Multipart -> MessageHeaders -> MessageBody -> m ()
Exported types
Memory-managed wrapper type.
Instances
| Eq Multipart Source # | |
| GBoxed Multipart Source # | |
Defined in GI.Soup.Structs.Multipart | |
| ManagedPtrNewtype Multipart Source # | |
Defined in GI.Soup.Structs.Multipart Methods toManagedPtr :: Multipart -> ManagedPtr Multipart | |
| TypedObject Multipart Source # | |
Defined in GI.Soup.Structs.Multipart | |
| HasParentTypes Multipart Source # | |
Defined in GI.Soup.Structs.Multipart | |
| IsGValue (Maybe Multipart) Source # | Convert |
Defined in GI.Soup.Structs.Multipart Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Multipart -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Multipart) | |
| type ParentTypes Multipart Source # | |
Defined in GI.Soup.Structs.Multipart | |
Methods
Click to display all available methods, including inherited ones
appendFormFile
multipartAppendFormFile Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Multipart |
|
| -> Text |
|
| -> Text |
|
| -> Text |
|
| -> Buffer |
|
| -> m () |
Adds a new MIME part containing body to multipart, using
"Content-Disposition: form-data", as per the HTML forms
specification. See formRequestNewFromMultipart for more
details.
Since: 2.26
appendFormString
multipartAppendFormString Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Multipart |
|
| -> Text |
|
| -> Text |
|
| -> m () |
Adds a new MIME part containing data to multipart, using
"Content-Disposition: form-data", as per the HTML forms
specification. See formRequestNewFromMultipart for more
details.
Since: 2.26
appendPart
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Multipart |
|
| -> MessageHeaders |
|
| -> Buffer |
|
| -> m () |
Adds a new MIME part to multipart with the given headers and body.
(The multipart will make its own copies of headers and body, so
you should free your copies if you are not using them for anything
else.)
Since: 2.26
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Multipart |
|
| -> m () |
Frees multipart
Since: 2.26
getLength
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Multipart |
|
| -> m Int32 | Returns: the number of body parts in |
Gets the number of body parts in multipart
Since: 2.26
getPart
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Multipart |
|
| -> Int32 |
|
| -> m (Bool, MessageHeaders, Buffer) | Returns: |
Gets the indicated body part from multipart.
Since: 2.26
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Multipart | Returns: a new empty |
Creates a new empty Multipart with a randomly-generated
boundary string. Note that mimeType must be the full MIME type,
including "multipart/".
Since: 2.26
newFromMessage
multipartNewFromMessage Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => MessageHeaders |
|
| -> MessageBody |
|
| -> m (Maybe Multipart) | Returns: a new |
Parses headers and body to form a new Multipart
Since: 2.26
toMessage
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Multipart |
|
| -> MessageHeaders |
|
| -> MessageBody |
|
| -> m () |
Serializes multipart to destHeaders and destBody.
Since: 2.26