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

Discussion in 'ASP General' started by Lakshmi Narayanan.R, Jul 7, 2005.

  1. [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
     
    Lakshmi Narayanan.R, Jul 7, 2005
    #1
    1. Advertising

  2. 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
     
    Lakshmi Narayanan.R, Jul 7, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2V2aW4gQnVydG9u?=

    Pre-Send Request Headers, Pre-Send Request Content

    =?Utf-8?B?S2V2aW4gQnVydG9u?=, Dec 31, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,108
    =?Utf-8?B?S2V2aW4gQnVydG9u?=
    Dec 31, 2004
  2. Replies:
    0
    Views:
    3,324
  3. Oodini
    Replies:
    1
    Views:
    1,822
    Keith Thompson
    Sep 27, 2005
  4. Replies:
    1
    Views:
    534
    Sion Arrowsmith
    Jul 10, 2008
  5. Ian
    Replies:
    2
    Views:
    2,075
Loading...

Share This Page