xml - Can someone tell me why I am not getting a response to MSXML2.ServerXMLHTTP.6.0 in classic asp? -


can tell me why not getting response?

<%     rssurl = "https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=nrcgov"      set xmlhttp = server.createobject("msxml2.serverxmlhttp.6.0")     xmlhttp.setproxy 2, "www.proxy.mydomain.com:80"     xmlhttp.open "get", rssurl, false     xmlhttp.send()     myxml = xmlhttp.responsetext     myxmlcode = xmlhttp.responsexml.xml      response.write(myxml)     response.write(myxmlcode)     response.write("hey") %> 

i trying rss feed xml twitter api onto server can manipulate client side code. can tell me why not getting feed code?

success! here problem:

  1. the reason got question mark was in binary format.
  2. responsetext causes encoding problem doctype in cross browser (which think why there no styles in chrome , there styles in ie on url itself)
  3. the proxy wasn’t necessary.
  4. msxml2.serverxmlhttp.6.0 causes encoding error on atom rss feeds.

i used responsebody , microsoft.xmlhttp instead:

url = "https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=myname" 'xmlhttp.setproxy 2, "www.proxy.mydomain.com:80"  set objhttp = createobject("microsoft.xmlhttp") objhttp.open "get", url, false objhttp.send rss = binarytostring(objhttp.responsebody) response.write(rss)  function binarytostring(byval binary)     '--- converts binary content text using adodb stream      '--- set return value in case of error     binarytostring = ""      '--- creates adodb stream     dim binarystream     set binarystream = createobject("adodb.stream")      '--- specify stream type     binarystream.type = 1 '--- adtypebinary      '--- open stream , write text/string data object     binarystream.open     binarystream.write binary      '--- change stream type text     binarystream.position = 0     binarystream.type = 2 '--- adtypetext      '--- specify charset source text (unicode) data     binarystream.charset = "utf-8"      '--- return converted text object     binarytostring = binarystream.readtext end function 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -