I am just now getting back to this :(

Here is what I added but I still get back a csv.

base64string = base64.encodestring('%s:%s' % (username, 
password)).replace('\n', '')
request.add_header("Authorization", "Basic %s" % base64string)  
request.add_header('Accept', 'application/json') 
response = urllib2.urlopen(request)



On Friday, January 15, 2016 at 4:31:35 AM UTC-5, Jochen Schalanda wrote:
>
> Hi,
>
> simply provide an Accept header (i. e. Accept: application/json; see 
> https://en.wikipedia.org/wiki/Content_negotiation) in your HTTP request 
> to always get a response with the application/json content type.
>
>
> Cheers,
> Jochen
>
> On Wednesday, 13 January 2016 22:54:01 UTC+1, packetsmacker wrote:
>>
>> So I see two/search/universal/absolute methods (sorry I can't see to 
>> recall the term at the moment) and the only difference I can see is one 
>> requires fields and returns a csv the other returns json and doesn't 
>> require feilds. Other then that I cant tell what is different. 
>> <http://157.89.60.157:12900/api-browser#!/Search/Absolute/searchAbsoluteChunked_get_0>
>>
>> The problem I have is my get used to return json. Now when I run the 
>> script it looks like it is failing because it is getting back a csv. So 
>> when I went to look at the documentation I couldn't figure out how graylog 
>> would know which way I wanted it to return the data. I think it was updated 
>> since the last time I ran my script but I don't take care of that side of 
>> the servers. How do I get it to return json? 
>>
>> <http://157.89.60.157:12900/api-browser#!/Search/Absolute/searchAbsoluteChunked_get_0>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Graylog Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/graylog2/e07e6d01-dc85-4023-a426-554d977ae2f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to