View Issue Details

IDProjectCategoryView StatusLast Update
0001399libmicrohttpdexternal APIpublic2008-09-10 20: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 08:33

manager   ~0003619

Fixed in SVN 7532.

Issue History

Date ModifiedUsernameFieldChange
2008-07-31 00:33faye2040New Issue
2008-08-06 08:33Christian GrothoffStatusnew => resolved
2008-08-06 08:33Christian GrothoffResolutionopen => fixed
2008-08-06 08:33Christian GrothoffAssigned To => Christian Grothoff
2008-08-06 08:33Christian GrothoffNote Added: 0003619
2008-09-10 20:49Christian GrothoffStatusresolved => closed
2013-05-06 10:52Christian GrothoffCategoryAPI => libmicrohttpd API
2024-01-21 12:24Christian GrothoffCategorylibmicrohttpd API => external API