You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The XML#parse(io : IO) method seems not working correctly on response.body_io.
require"http/client"require"xml"
url ="https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi"
form = {
"db" => "gene",
"id" => "1956"
}
HTTP::Client.post_form(url, form) do |response|
if response.status_code ==200# xml = XML.parse(response.body_io.gets_to_end) # this is ok
xml =XML.parse(response.body_io) # not workingp xml.to_xml
endend
Btw, the same example on play gave the following error:
Program received and didn't handle signal SYS (31)
The text was updated successfully, but these errors were encountered:
Hmm... for some reason xml doesn't like to be fed small chunks of bytes. This happens because the current ssl socket is not buffered. If I change it to buffer it starts working well. I guess that's a solution though I don't know why libxml works wrong otherwise.
The XML#parse(io : IO) method seems not working correctly on response.body_io.
Btw, the same example on play gave the following error:
The text was updated successfully, but these errors were encountered: