We help IT Professionals succeed at work.

how to read http headers

newbie27
newbie27 asked
on
537 Views
Last Modified: 2013-11-21
Hello Experts,
I am doing a remote call to the server passing the cookie information in the headers. I wanted to know whether the values are been passed correctly or not. Can someone please let me know If there is any way I can do this?
Many thanks for your help.
Regards
Sam
Comment
Watch Question

Author

Commented:
I am using the attached code snippet for the call, this is how I am passing the cookie information.

myXidHttp.setRequestHeader "Cookie","xg9oecdxgxsM=" & request.cookies("xg9oecdxgxsM") & "; " & "xg9oecdxgxsC=" & request.cookies("xg9oecdxgxsC")

Please can someone advice me how to check whether values been passedcorrectly, I mean, all I wanted to do is to check the HHTP headers.Please advice.




set myXidHttp = createObject("Msxml2.SERVERXMLHTTP")
		myXidHttp.open "GET", theXidFile, false  '-- ,authuser,authpassword
		myXidHttp.setRequestHeader "Cookie","this is needed to avoid a microsoft bug"
		 
		myXidHttp.setRequestHeader "Cookie","test=tested;testoecdM=testvalue;xg9oecdxgxsM=fcda9aa677ac04a0eb2f33293a1de705;xg9oecdxgxsC=fcda9aa677ac04a0eb2f33293a1de705"		
		

Open in new window

IT Manager
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
b0lsc0ttIT Manager
CERTIFIED EXPERT

Commented:
Instead of cookie you probably need to use Set-cookie.

yourObject.getResponseHeader("set-cookie")

The best method to know what is actually in the cookie would be to use Request.Cookie() on the remote server but you might see what you need in the response by using the line above, especially because your request is setting the cookie value.

Let me know how this helps or if I have misunderstood what you need.

bol

Author

Commented:
Hello Bol,
Thanks for picking this up for me, this has helped me to check the value on the other end.

Response.Write "The header I get has this for cookie: " & myXidHttp.getResponseHeader("Cookie")

I have now managed to pass the correct cookie information in the header and the discount is now working on the server.

Thanks for your help.

Regards
Sam

Author

Commented:
thanks
b0lsc0ttIT Manager
CERTIFIED EXPERT

Commented:
Great!  Your welcome!  Thanks for letting me know which worked.  I'm glad I could help.  Thanks for the grade, the points and the fun question.  I'll see you around. :)

bol

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.