www.webdeveloper.com
Results 1 to 4 of 4

Thread: Unable to read vbLf and vbTab in POST request

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    3

    Unable to read vbLf and vbTab in POST request

    Hello All. I'm afraid I'm in desperate need of help. I'm trying to understand why tabs and line feeds aren't coming through a POST request. Here's the code to reproduce:

    POST request:

    Code:
    str = "accountRequest=<NewUser>" & vbLf & _
    "Hello" & vbTab & "World" & vbLf & _
    "</NewUser>"
    
    
    Set objHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
    objHTTP.open "POST", "service.asp", False 
    objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    objHTTP.send str
    
    response.Write(objHTTP.responseText)
    
    Set objHTTP = Nothing

    service.asp

    Code:
    function w (str)
    response.Write(str & "<br>")
    end function
    
    str = request.Form("accountRequest")
    
    w(str)
    w("Tabs: "& InStr(str,vbTab))
    w("Lines: "& InStr(str,vbLf))
    output:

    Code:
    HelloWorld
    Tabs: 0
    Lines: 0

  2. #2
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    Because they are written (and processed) in the code on the sending page. You would need to include them inside your quotations to POST them.

  3. #3
    Join Date
    Feb 2012
    Posts
    3
    I used wireshark and it seems shows the "\t" representing the tab in the POST.

  4. #4
    Join Date
    Feb 2012
    Posts
    3
    Finally figured out that ASP Request method doesn't preserve tabs if they're in the "\t" format (as opposed to URL encoded). However, PHP's $_POST does.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles