diff options
author | Dan Winship <danw@src.gnome.org> | 2008-10-01 21:53:26 +0000 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2008-10-01 21:53:26 +0000 |
commit | 264eb7480e3a1c5762e4eb51f8273e6e438ff87b (patch) | |
tree | dfbcf59e3123dbebec3a70a42e9e89a7ab8974e8 /libsoup/soup-form.h | |
parent | 91d657fb12308d51608dd3f6b6c4b3fa6b117bee (diff) | |
download | libsoup-264eb7480e3a1c5762e4eb51f8273e6e438ff87b.tar.gz |
New type and methods for working with multipart HTTP bodies (eg,
* libsoup/soup-multipart.c: New type and methods for working with
multipart HTTP bodies (eg, multipart/form-data and
multipart/byte-ranges)
* libsoup/soup-message-headers.c (soup_message_headers_get_ranges)
(soup_message_headers_set_ranges)
(soup_message_headers_set_range)
(soup_message_headers_get_content_range)
(soup_message_headers_set_content_range): New methods for dealing
with the Range and Content-Range headers.
* libsoup/soup-form.h (SOUP_FORM_MIME_TYPE_URLENCODED)
(SOUP_FORM_MIME_TYPE_MULTIPART): #define these MIME types here
* libsoup/soup-form.c (soup_form_decode_multipart): new utility
for parsing multipart/form-data forms.
(soup_form_request_new_from_multipart): new utility for
constructing multipart/form-data forms
* libsoup/soup-headers.c (soup_headers_parse): this is now
non-static, for use by soup-multipart
* libsoup/soup-message-server-io.c (get_response_headers)
(handle_partial_get): if the client requested a partial GET, and
the SoupServer is returning the full body, rebuild the response to
include only the requested range instead
* tests/forms-test.c: renamed from query-test and updated to do
both application/x-www-form-urlencoded and multipart/form-data
tests
* tests/range-test.c: test of Range/Content-Range functionality
svn path=/trunk/; revision=1176
Diffstat (limited to 'libsoup/soup-form.h')
-rw-r--r-- | libsoup/soup-form.h | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/libsoup/soup-form.h b/libsoup/soup-form.h index 9db5abf0..f2be1bcf 100644 --- a/libsoup/soup-form.h +++ b/libsoup/soup-form.h @@ -7,17 +7,26 @@ #define SOUP_FORM_H 1 #include <libsoup/soup-types.h> +#include <libsoup/soup-multipart.h> G_BEGIN_DECLS -GHashTable *soup_form_decode (const char *encoded_form); +#define SOUP_FORM_MIME_TYPE_URLENCODED "application/x-www-form-urlencoded" +#define SOUP_FORM_MIME_TYPE_MULTIPART "multipart/form-data" -char *soup_form_encode (const char *first_field, - ...) G_GNUC_NULL_TERMINATED; -char *soup_form_encode_hash (GHashTable *form_data_set); -char *soup_form_encode_datalist (GData **form_data_set); -char *soup_form_encode_valist (const char *first_field, - va_list args); +GHashTable *soup_form_decode (const char *encoded_form); +GHashTable *soup_form_decode_multipart (SoupMessage *msg, + const char *file_control_name, + char **filename, + char **content_type, + SoupBuffer **file); + +char *soup_form_encode (const char *first_field, + ...) G_GNUC_NULL_TERMINATED; +char *soup_form_encode_hash (GHashTable *form_data_set); +char *soup_form_encode_datalist (GData **form_data_set); +char *soup_form_encode_valist (const char *first_field, + va_list args); #ifndef LIBSOUP_DISABLE_DEPRECATED /* Compatibility with libsoup 2.3.0 */ @@ -26,16 +35,18 @@ char *soup_form_encode_valist (const char *first_field, #define soup_form_encode_urlencoded_list soup_form_encode_datalist #endif -SoupMessage *soup_form_request_new (const char *method, - const char *uri, - const char *first_field, - ...) G_GNUC_NULL_TERMINATED; -SoupMessage *soup_form_request_new_from_hash (const char *method, - const char *uri, - GHashTable *form_data_set); -SoupMessage *soup_form_request_new_from_datalist (const char *method, - const char *uri, - GData **form_data_set); +SoupMessage *soup_form_request_new (const char *method, + const char *uri, + const char *first_field, + ...) G_GNUC_NULL_TERMINATED; +SoupMessage *soup_form_request_new_from_hash (const char *method, + const char *uri, + GHashTable *form_data_set); +SoupMessage *soup_form_request_new_from_datalist (const char *method, + const char *uri, + GData **form_data_set); +SoupMessage *soup_form_request_new_from_multipart (const char *uri, + SoupMultipart *multipart); G_END_DECLS |