By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,272 Members | 1,452 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,272 IT Pros & Developers. It's quick & easy.

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

P: n/a
[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
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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")
%>
====================================

"Lakshmi Narayanan.R" wrote:
[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

Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.