Fix content header
This commit is contained in:
3
main.rb
3
main.rb
@@ -13,5 +13,6 @@ get "/deck_xml" do
|
|||||||
api_url = "https://api2.moxfield.com/v3/decks/all/" + deck_id
|
api_url = "https://api2.moxfield.com/v3/decks/all/" + deck_id
|
||||||
content = HTTP.headers({"User-Agent" => USER_AGENT, 'Accept' => 'application/json'}).get(api_url)
|
content = HTTP.headers({"User-Agent" => USER_AGENT, 'Accept' => 'application/json'}).get(api_url)
|
||||||
puts content
|
puts content
|
||||||
JSON.parse(content).to_xml(:root => :deck)
|
xml_data = JSON.parse(content).to_xml(:root => :deck)
|
||||||
|
[200, {"Content-Type" => "application/xml"}, xml_data]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user