473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

[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
1 6490
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: fr? | last post by:
Hi, I'm trying to send HTTP GET (or POST) requests to a server. This server accepts these requests only from the IP-address of my server, not of my client pc. So, some data generated on the...
1
by: Aliandro | last post by:
Hi I am really stuck and need some expertise help please. I have an XML file: <XML> <USER_INFO> <USERNAME>username</USERNAME> <PASSWORD>password%</PASSWORD> </USER_INFO> <SITE_INFO>...
1
by: searcher1234 | last post by:
I have wrote a web server by C language. but I don't know how to send back error page to web browser if user type wrong web address or name that will show HTTP/1.0 404 NOT FOUND. One more is how...
2
by: inferno2000 | last post by:
Let's say if I want to send a http "Post" request to a url, and check the http status code later. How should I write the code? I have found example to use WinHttp to send "Get" request and check...
11
by: afrinspray | last post by:
I get this error everytime I finish an AJAX post with http.send(null): Error: uncaught exception: " nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: :: getReplyWindow :: line...
6
by: gaurierram | last post by:
Hii, I want to send data from a pocket pc to a desktop. It is to be done by sending a http request.Can I get the code for that? Pocket pc has C#.net 1.0 and desktop has c#.net2.0. What other...
1
ashsa
by: ashsa | last post by:
Hi, Could someone please illustrate how to send and receive HTTP requests programmatically through any HTTP proxy. Say if I have the ip address and the port number of a...
0
by: Atul Goyal | last post by:
Hello I want to send Http request by using swing . Can you help me fot that. ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.