ropensci / bold

Interface to the Bold Systems barcode webservice
https://docs.ropensci.org/bold
Other
17 stars 11 forks source link

Getting "HTTP 500: Internal Server Error - Server got itself in trouble" when taxon names have single quotes in them #84

Closed salix-d closed 1 year ago

salix-d commented 2 years ago

Seems like the Taxonomy API server can't handle single quotes characters.

> bold::bold_tax_name("Chlamydomonas sp. 'Chile J'")
Error: Internal Server Error (HTTP 500)
> bold::bold_tax_name(curl::curl_escape("Chlamydomonas sp. 'Chile J'"))
                                  input
1 Chlamydomonas%20sp.%20%27Chile%20J%27
> bold::bold_tax_name("Chlamydomonas sp. \'Chile J\'")
Error: Internal Server Error (HTTP 500)
> bold::bold_tax_name("Chlamydomonas sp. \\'Chile J\\'")
    taxid                      taxon tax_rank tax_division parentid    parentname specimenrecords                           input
1 1082557 Chlamydomonas sp. 'Chile J  species      Plantae   440637 Chlamydomonas               1 Chlamydomonas sp. \\'Chile J\\'

The arguments should be checked for single quotes and fixed before building the URL(s).

salix-d commented 1 year ago

related: https://github.com/ropensci/bold/issues/85#issuecomment-1111085637

salix-d commented 1 year ago

Made a check and fix function to fix this and the problem with names ending with a dots (sp.) or closing parenthesis (#85). Will contact bold to let them know.