Forum Moderators: open

Message Too Old, No Replies

Problem with XMLHTTP in ASP 3.0

         

suraj_ajax

7:29 am on Mar 4, 2009 (gmt 0)

10+ Year Member



Hi

i have been trying to get the contents from a webpage using MSXML2.ServerXMLHTTP . Although i had done the same in past without any issues..

but now while get a content from a page , i am getting no response.text . Have checked the status it says 200. Seems like the problem is due to character encoding .

Code i am using is

<%
strUrl="http://indiacode.nic.in/qrydisp.asp?tfnm=188712%20&tfnm2=1"
Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP")
xmlHttp.Open "GET", strUrl, False
xmlHttp.setRequestHeader "User-Agent", "asp httprequest"
xmlhttp.setRequestHeader "Content-type", "text/xml; charset=utf-16"
xmlHttp.Send
getHTML = xmlHttp.responseText
xmlHttp.abort()
set xmlHttp = Nothing
response.write getHTML
%>

Can u please guide me how to get the contents..

[edited by: coopster at 9:14 pm (utc) on Mar. 4, 2009]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]

Ocean10000

11:54 pm on Mar 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well one of the things that I could think of is that they are blocking your request and setting a 200 status code, to make you pull your hair out.

suraj_ajax

9:30 am on Mar 25, 2009 (gmt 0)

10+ Year Member



Hi

I finally got the solution.. here is the tweak..

just replaced

getHTML = xmlHttp.responseText

with

getHTML = xmlHttp.ResponseBody

Thanks for replying Ocean10000

Regards
Suraj jain