Import line: | Soup = imports.gi.Soup; |
GIR File: | Soup-2.4.gir |
C documentation: | SoupMessageBody |
Struct : | MessageBody |
Show / Hide Inherited methods, properties and signals |
Properties | Defined By | |
---|---|---|
data : String
|
Soup.MessageBody | |
length : Number
|
Soup.MessageBody |
Method / Constructor | Defined By | |
---|---|---|
new Soup.MessageBody
()
Create a new Soup.MessageBody
Create a new Soup.MessageBody
|
||
Appends length bytes from data to body.
Appends length bytes from data to body. This function is exactly equivalent to soup_message_body_apppend() with SOUP_MEMORY_TAKE as second argument; it exists mainly for convenience and simplifying language bindings.
|
Soup.MessageBody | |
append_buffer
(Buffer buffer)
:
none
Appends the data from buffer to body.
Appends the data from buffer to body. (SoupMessageBody uses SoupBuffers internally, so this is normally a constant-time operation that doesn't actually require copying the data in
|
Soup.MessageBody | |
complete
()
:
none
Tags body as being complete; Call this when using chunked encoding after you have appended the last chunk.
Tags body as being complete; Call this when using chunked encoding after you have appended the last chunk.
|
Soup.MessageBody | |
flatten
()
:
Soup.Buffer
Fills in body's data field with a buffer containing all of the data in body (plus an additional '\0' byte not counted by body's length field).
Fills in body's data field with a buffer containing all of the data in body (plus an additional '\0' byte not counted by body's length field). (You must free this buffer if you do not want it.)
|
Soup.MessageBody | |
free
()
:
none
Frees body.
Frees body. You will not normally need to use this, as SoupMessage frees its associated message bodies automatically.
|
Soup.MessageBody | |
get_accumulate
()
:
Boolean
Gets the accumulate flag on body; see soup_message_body_set_accumulate() for details.
Gets the accumulate flag on body; see soup_message_body_set_accumulate() for details.
|
Soup.MessageBody | |
get_chunk
(Number offset)
:
Soup.Buffer
Gets a SoupBuffer containing data from body starting at offset.
Gets a SoupBuffer containing data from body starting at offset. The size of the returned chunk is unspecified. You can iterate through the entire body by first calling soup_message_body_get_chunk() with an offset of 0, and then on each successive call, increment the offset by the length of the previously-returned chunk. If offset is greater than or equal to the total length of body, then the return value depends on whether or not soup_message_body_complete() has been called or not; if it has, then soup_message_body_get_chunk() will return a 0-length chunk (indicating the end of body). If it has not, then soup_message_body_get_chunk() will return NULL (indicating that currently available).
|
Soup.MessageBody | |
got_chunk
(Buffer chunk)
:
none
Handles the SoupMessageBody part of receiving a chunk of data from the network.
Handles the SoupMessageBody part of receiving a chunk of data from the network. Normally this means appending chunk to body, exactly as with soup_message_body_append_buffer(), but if you have set This is a low-level method which you should not normally need to use.
|
Soup.MessageBody | |
set_accumulate
(Boolean accumulate)
:
none
Sets or clears the accumulate flag on body.
Sets or clears the accumulate flag on body. (The default value is TRUE.) If set to FALSE, body's data field will not be filled in after the body is fully sent/received, and the chunks that make up In particular, if you set this flag to FALSE on an "incoming" message body (that is, the response_body of a client-side message, or request_body of a server-side message), this will cause each chunk of the body to be discarded after its corresponding SoupMessage::got_chunk signal is emitted. (This is equivalent to setting the deprecated SOUP_MESSAGE_OVERWRITE_CHUNKS flag on the message.) If you set this flag to FALSE on the response_body of a server-side message, it will cause each chunk of the body to be discarded after its corresponding SoupMessage::wrote_chunk signal is emitted. (If you set the flag to FALSE on the request_body of a client-side message, it will block the accumulation of chunks into discarded after being written like in the server-side response_body case, because the request body needs to be kept around in case the request needs to be sent a second time due to redirection or authentication.)
|
Soup.MessageBody | |
truncate
()
:
none
Deletes all of the data in body.
Deletes all of the data in body.
|
Soup.MessageBody | |
wrote_chunk
(Buffer chunk)
:
none
Handles the SoupMessageBody part of writing a chunk of data to the network.
Handles the SoupMessageBody part of writing a chunk of data to the network. Normally this is a no-op, but if you have set body's accumulate flag to FALSE, then this will cause chunk to be discarded to free up memory. This is a low-level method which you should not need to use, and there are further restrictions on its proper use which are not documented here.
|
Soup.MessageBody |
None |
Class / Namespace | Method / Signal / Properties |
---|---|
Soup.Message
Property |
request_body : Soup.MessageBody
read only
|
Soup.Message
Property |
response_body : Soup.MessageBody
read only
|
Soup.Multipart
Method |
Create a new Soup.Multipart
|
Soup.Multipart
Method |
to_message
(MessageHeaders dest_headers, MessageBody dest_body)
:
none
Serializes multipart to dest_headers and dest_body.
|