arthur-shaw / susoapi

R interface for Survey Solutions' APIs
https://arthur-shaw.github.io/susoapi/
Other
9 stars 5 forks source link

Compose URL correctly--when has terminal `/` #42

Open arthur-shaw opened 9 months ago

arthur-shaw commented 9 months ago

Previously, used paste0() to compose the URL: base URL + path. When the URL contained a / at the end, the request URL was mal-formed--in particular, it had an extra / in the path. To address this, use httr::modify_url() which is to URLs what fs::path() is to file paths--meaning it correctly "concatenates" components of a path.

arthur-shaw commented 5 months ago

TODO: add tests that check whether the URL can be specified with or without a terminal /.