Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

malformed HTTP header? #212

Open
longemen3000 opened this issue Dec 18, 2022 · 0 comments
Open

malformed HTTP header? #212

longemen3000 opened this issue Dec 18, 2022 · 0 comments

Comments

@longemen3000
Copy link

i'm getting this warning on Downloads v1.6.0, julia 1.8.3, and trying to call api.crossref.org to get BibTeX from doi.

using Downloads
function doi2bib(doi)
    headers = ["Accept"=>"application/x-bibtex",
                "charset" => "utf-8"]
    
    url = "https://api.crossref.org/v1/works/" * doi * "/transform"
    out = IOBuffer()
    r = Downloads.request(url, output = out, method = "GET",headers = headers)
    if r.status == 200
        return String(take!(out))
    else  
        return ""
    end
end

with that function:

dois =  ["10.1021/I160057A011"
 "10.1016/0378-3812(80)80003-3"
 "10.1016/j.fluid.2020.112790"]
for doi in dois
  doi2bib(doi)
end

it gives a warning on the third doi:

┌ Warning: malformed HTTP header
│   url = "https://api.crossref.org/v1/works/10.1063/1.5136079/transform"
│   status = 200
│   header = "link: <http://dx.doi.org/10.1063/1.5136079>; rel=\"canonical\", <http://aip.scitation.org/doi/pdf/10.1063/1.5136079>; version=\"vor\"; rel=\"item\", <http://orcid.org/0000-0002-7436-5825>; title=\"Ailo Aasen\"; rel=\"author\", <http://orcid.org/0000-0002-0921-7527>; title=\"Morten Hammer\"; rel=\"author\", <http://orcid.org/0000-0002-1513-6686>; title=\"Erich A. M\xfcller\"; rel=\"author\"\r\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant