I am writing an application that is supposed to fetch the source code of a page and show it.
It will be a simple JSON format, no HTML nor CSS whatsoever. So the source code of the site that I'm trying to fetch looks like this:
{"latitude" : "n/a","longitude" : "n/a","internalTemperature" : "n/a","light" : "n/a","distance" : "n/a" ...
and every time, using httparty, I get something like this:
#, @headers={"x-frame-options"=>["sameorigin"], "x-xss-protection"=>["1; mode=block"], "content-type"=>["text/html;charset=utf-8"], "content-length"=>["86692"], "server"=>["WEBrick/1.3.1 (Ruby/1.9.2/2012-04-20)"], "date"=>["Wed, 09 May 2012 17:46:34 GMT"], "connection"=>["close"]}>
What is that type of data?, I don't understand.
I have in my erb file a line like this:
<%= Representative.get('http://0.0.0.0:4568/').inspect %>
And in my .rb file:
class Representative
include HTTParty
end
Obviously the site that I'm reaching is on my localhost so you can't see it, but it returns a simple JSON like I showed.