How to get/set and send the HTTP Headers(user-defined)

  • Thread starter Lakshmi Narayanan.R
  • Start date
L

Lakshmi Narayanan.R

[Qtn : How to get/set and send the HTTP Headers(user-defined) coming from
another domain/site]

Hi Experts,

In one SMS gateway project i need a great and urgent help from u all. There,
the Service Providers sending the data thru "HTTP Headers" (For ex.
sms-Id,sms-source [user defined]).
So i need to get and parse the name value pairs, and need to respond/send
the same way as coining the "HTTP Headers" (For ex.
sms-Id,sms-destination,sms-msg [user defined]).

Pls its urgent.

thanx in advance
Laks.R
 
L

Lakshmi Narayanan.R

Hi Experts!

The answer is Found!!!

Yes,
1) Using "xmlhttp.setRequestHeader", we can coin the headers
2) Using Request.ServerVariables("HTTP_<header-name>")), we can list the value

thanx and regards
Laks.R

=====================================
<%
'Header3.asp

url = "http://prism04/asp/header4.asp"
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
xmlhttp.setRequestHeader "MyName", "Lakshmi Narayanan.R"
xmlhttp.setRequestHeader "MyName1", "Lakshmi Narayanan.R"
xmlhttp.send "x=1&y=2"

Response.Write "<br>Status " & xmlhttp.status
Response.write "<br>Content " & xmlhttp.responseText
set xmlhttp = nothing
%>
=====================================
<%
'Header4.asp

dim fs,fname
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fname=fs.CreateTextFile("C:\Inetpub\wwwroot\asp\db\test.txt",true)
fname.WriteLine(Request.ServerVariables("ALL_RAW"))
'fname.WriteLine(Request.Form("x"))
'fname.WriteLine(Request.Form("y"))
fname.Close
set fname=nothing
set fs=nothing
Response.Write("Success")
%>
====================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top