1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2/*
3 * Copyright 2008 Red Hat, Inc.
4 */
5
6#ifndef __SOUP_FORM_H__
7#define __SOUP_FORM_H__ 1
8
9#include <libsoup/soup-types.h>
10#include <libsoup/soup-multipart.h>
11
12G_BEGIN_DECLS
13
14#define SOUP_FORM_MIME_TYPE_URLENCODED "application/x-www-form-urlencoded"
15#define SOUP_FORM_MIME_TYPE_MULTIPART "multipart/form-data"
16
17SOUP_AVAILABLE_IN_2_4
18GHashTable *soup_form_decode (const char *encoded_form);
19SOUP_AVAILABLE_IN_2_26
20GHashTable *soup_form_decode_multipart (SoupMessage *msg,
21 const char *file_control_name,
22 char **filename,
23 char **content_type,
24 SoupBuffer **file);
25
26SOUP_AVAILABLE_IN_2_4
27char *soup_form_encode (const char *first_field,
28 ...) G_GNUC_NULL_TERMINATED;
29SOUP_AVAILABLE_IN_2_4
30char *soup_form_encode_hash (GHashTable *form_data_set);
31SOUP_AVAILABLE_IN_2_4
32char *soup_form_encode_datalist (GData **form_data_set);
33SOUP_AVAILABLE_IN_2_4
34char *soup_form_encode_valist (const char *first_field,
35 va_list args);
36
37#ifndef SOUP_DISABLE_DEPRECATED
38/* Compatibility with libsoup 2.3.0 */
39#define soup_form_decode_urlencoded soup_form_decode
40#define soup_form_encode_urlencoded soup_form_encode_hash
41#define soup_form_encode_urlencoded_list soup_form_encode_datalist
42#endif
43
44SOUP_AVAILABLE_IN_2_4
45SoupMessage *soup_form_request_new (const char *method,
46 const char *uri,
47 const char *first_field,
48 ...) G_GNUC_NULL_TERMINATED;
49SOUP_AVAILABLE_IN_2_4
50SoupMessage *soup_form_request_new_from_hash (const char *method,
51 const char *uri,
52 GHashTable *form_data_set);
53SOUP_AVAILABLE_IN_2_4
54SoupMessage *soup_form_request_new_from_datalist (const char *method,
55 const char *uri,
56 GData **form_data_set);
57SOUP_AVAILABLE_IN_2_26
58SoupMessage *soup_form_request_new_from_multipart (const char *uri,
59 SoupMultipart *multipart);
60
61G_END_DECLS
62
63#endif /* __SOUP_FORM_H__ */
64