1

Problem

I want to retrieve value of a header in my custom Apache module. (The header is coming as part of a POST request.) I am doing this:

const char *myHeader = apr_table_get(r->headers_in, "MyHeader");

But, this is giving myHeader = NULL.

Details

I am using the myHeader here:

sprintf(query, query_template, myHeader, 2);

query is formatted using query_template = "call GetDelay('%s', %d)" and executed on the DB. DB shows the executed query as GetDelay('(null)',2).

How to retrieve header values? Or what is my mistake?

Community
  • 1
  • 1
mmdemirbas
  • 9,060
  • 5
  • 45
  • 53
  • And these came in as part of the request? Or did you use say `apr_table_mergen` to add them to `headers_in`? – user7116 Sep 11 '12 at 15:43
  • @sixlettervariables It comes as part of a POST request. – mmdemirbas Sep 11 '12 at 15:44
  • Your approach is correct, but you have give us more details about your module. For example, what kind of module is this, where are you trying to get the header from, the context of the apr_table_get call, etc. – Boris Oct 18 '12 at 18:06

0 Answers0