Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

GetServerVariable or GetHeader?

Posted on 2006-07-10
5
Medium Priority
?
341 Views
Last Modified: 2013-11-20
Hi,

Im making an ISAPI filter and i need to check the value of HTTP HEADER - "HTTP_X_UP_SUBNO" which is a header which WAP phones use.

Im using -

if (pCtxt->GetServerVariable("HTTP_X_UP_SUBNO", szAddress, &dwSize))
{
// do something
}
else
{
//failed
}

it always goes into the failed code with GetLastError returning ERROR_INVALID_INDEX.

Am i using the wrong function? GetHeader doesnt seem to work either.

Ive done a server variables dump in ASP and i definately have the 'HTTP_X_UP_SUBNO' header and it has a value but still i get ERROR_INVALID_INDEX.
0
Comment
Question by:x2cmsac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 22

Expert Comment

by:mahesh1402
ID: 17075278
Is this the case with u  : http://support.microsoft.com/default.aspx?scid=kb;en-us;294217 <=

-MAHESH
0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 2000 total points
ID: 17075328
As said any underscore ( _ ) that follows "HTTP_" is incorrectly converted to a dash when IIS attempts to retrieve the custom header value for the variable, and therefore, the variable is not found.

So resolve this you :

Do not use an underscore in the custom HTTP header variable name.

-OR-

Retrieve and parse the HTTP_ALL header variable for the custom HTTP header variable.


-MAHESH
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question