• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
12 G_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 
17 SOUP_AVAILABLE_IN_2_4
18 GHashTable  *soup_form_decode           (const char   *encoded_form);
19 SOUP_AVAILABLE_IN_2_26
20 GHashTable  *soup_form_decode_multipart (SoupMessage  *msg,
21 					 const char   *file_control_name,
22 					 char        **filename,
23 					 char        **content_type,
24 					 SoupBuffer  **file);
25 
26 SOUP_AVAILABLE_IN_2_4
27 char        *soup_form_encode           (const char   *first_field,
28 					 ...) G_GNUC_NULL_TERMINATED;
29 SOUP_AVAILABLE_IN_2_4
30 char        *soup_form_encode_hash      (GHashTable   *form_data_set);
31 SOUP_AVAILABLE_IN_2_4
32 char        *soup_form_encode_datalist  (GData       **form_data_set);
33 SOUP_AVAILABLE_IN_2_4
34 char        *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 
44 SOUP_AVAILABLE_IN_2_4
45 SoupMessage *soup_form_request_new                (const char     *method,
46 						   const char     *uri,
47 						   const char     *first_field,
48 						   ...) G_GNUC_NULL_TERMINATED;
49 SOUP_AVAILABLE_IN_2_4
50 SoupMessage *soup_form_request_new_from_hash      (const char     *method,
51 						   const char     *uri,
52 						   GHashTable     *form_data_set);
53 SOUP_AVAILABLE_IN_2_4
54 SoupMessage *soup_form_request_new_from_datalist  (const char     *method,
55 						   const char     *uri,
56 						   GData         **form_data_set);
57 SOUP_AVAILABLE_IN_2_26
58 SoupMessage *soup_form_request_new_from_multipart (const char     *uri,
59 						   SoupMultipart  *multipart);
60 
61 G_END_DECLS
62 
63 #endif /* __SOUP_FORM_H__ */
64