View Issue Details

IDProjectCategoryView StatusLast Update
0001399libmicrohttpdexternal APIpublic2008-09-10 22:49
Reporterfaye2040 Assigned ToChristian Grothoff  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version0.3.1 
Summary0001399: Perhaps add MHD_set_connection_headers to modify HTTP request headers
Descriptionlearn from MHD_get_connection_values, I propose to add
int MHD_set_connection_headers (struct MHD_Connection *connection,
                                const char *key,
                                const char *value);

Thus, before doing MHD_create_post_processor, we could add some missing
headers of requesting for later correct post processing.

In fact, in our project team, there are some HTTP clients coming from Windows
platform. So far as I know, Windows API has simple HTTP POST feature.

However, Windows's API does not add header by default in its POST action
Content-type: application/x-www-form-urlencoded

Thus, libmicrohttpd always fail to handle such POST request,
in int httpd_request_callback (
  void *cls, struct MHD_Connection *connection, const char *url,
  const char *method, const char *version, const char *upload_data,
  unsigned int *upload_data_size, void **ptr);

we could "modify" the header before MHD_create_post_processor,
For example,
if (MHD_lookup_connection_value(connection,
                                MHD_HEADER_KIND,
                                "Content-type") == NULL)
  MHD_set_connection_headers(connection,
                             "Content-type",
                             "application/x-www-form-urlencoded");

and then create post_processor.

So, any similar idea that can fulfill such purpose is welcome, too.
   
TagsNo tags attached.

Activities

Christian Grothoff

2008-08-06 10:33

manager   ~0003619

Fixed in SVN 7532.

Issue History

Date Modified Username Field Change
2008-07-31 02:33 faye2040 New Issue
2008-08-06 10:33 Christian Grothoff Status new => resolved
2008-08-06 10:33 Christian Grothoff Resolution open => fixed
2008-08-06 10:33 Christian Grothoff Assigned To => Christian Grothoff
2008-08-06 10:33 Christian Grothoff Note Added: 0003619
2008-09-10 22:49 Christian Grothoff Status resolved => closed
2013-05-06 12:52 Christian Grothoff Category API => libmicrohttpd API
2024-01-21 13:24 Christian Grothoff Category libmicrohttpd API => external API