http.Get returns nothing in GMod, but returns as expected in internet browser.

Hello. I’m working on a project that requires information one can obtain from the profile page of a user. For this I am querying their profile using and xml argument on the string, so that I can then decode the XML ( using GXML , not that this information is of any use ), and gather the required information. When I first tested this, it failed. After looking through my work, I can only think that http.Get is of cause. Here is an example:

[lua]
http.Get( “http://steamcommunity.com/profiles/76561198006055559/?xml=1” , “” , function( c ) print( c ) end ) – I don’t need the size argument
[/lua]

This code should normally query my profile, and return this ( I have clipped the result, no need for all the information ) :



<profile>
<steamID64>76561198006055559</steamID64>
<steamID>
<![CDATA[ Neo ]]>
</steamID>
<onlineState>offline</onlineState>
<stateMessage>
<![CDATA[ Last Online: 20 hrs, 44 mins ago ]]>
</stateMessage>
<privacyState>public</privacyState>
<visibilityState>3</visibilityState>
[...]
</profile>


But, what I actually get is nothing at all. If I were to print the size argument, it would be 0. The next logical thing for me to think was that it was a header error. In my backwards way of thinking, I did the same test, except with a false ID in the URL. Surprisingly , I get this in both GMod and not Chrome ( contrary to the first test, due to a redirection I think ):



<?xml version="1.0" encoding="UTF-8" standalone="yes"?><profile>
	<steamID64>765861198006055559</steamID64>
	<steamID><![CDATA[]]></steamID>
	<vacBanned>0</vacBanned>
	<tradeBanState>None</tradeBanState>
	<privacyMessage>This user has not yet set up their Steam Community profile.<br />If you know them encourage him/her to set up their profile and join in on the gaming!</privacyMessage>
</profile>


In other words, My URL won’t work, but a false one will, and this only in GMod. I am at a loss here Facepunch, could someone help me?

Have you tried running something like Fiddler during gmod’s request? Perhaps an HTTP debugger like this could shed some light on what the real problem is.

I wonder if this has something to do with the useragent gmod gives…

http.Get does not support redirects, which I suppose is the issue here.