Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How to get/set and send the HTTP Headers(user-defined)

Reply
Thread Tools

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

 
 
Lakshmi Narayanan.R
Guest
Posts: n/a
 
      07-07-2005
[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
 
Reply With Quote
 
 
 
 
Lakshmi Narayanan.R
Guest
Posts: n/a
 
      07-07-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Send Basic HTTP authentication credential in the first HTTP request Nacho Nachev ASP .Net Web Services 2 09-05-2012 08:49 PM
HTTP SOAP/HTTP GET/HTTP POST milan_9211 Software 0 01-10-2011 02:10 PM
How to send a http::get or http::post with a cookie? mrpink Ruby 2 04-22-2007 07:57 AM
how can i simulate my pc as http server by writing java code to send the http response by socketstream to some pc in the internet?! mike Java 5 09-21-2004 02:04 PM



Advertisments