Skip to content

Commit

Permalink
Explicitly request XML from parldata API
Browse files Browse the repository at this point in the history
There has been a change recently which meant that the parldata API was
returning JSON by default, rather than the XML that we are using.

This change adds an explicit `Accept` header and sets it to XML so we
get back the correct data type.
  • Loading branch information
chrismytton committed Jan 25, 2017
1 parent 39b6af5 commit 42fd8af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper.rb
Expand Up @@ -14,7 +14,7 @@
@API_URL = 'http://api.parldata.eu/kv/kuvendi/%s'

def noko_q(endpoint, h)
result = RestClient.get (@API_URL % endpoint), params: h
result = RestClient.get (@API_URL % endpoint), params: h, accept: :xml
warn result.request.url
doc = Nokogiri::XML(result)
doc.remove_namespaces!
Expand Down

0 comments on commit 42fd8af

Please sign in to comment.