polite icon indicating copy to clipboard operation
polite copied to clipboard

is_url function does not recognise urls with localhost

Open fruchtblase opened this issue 1 year ago • 0 comments

Hello everyone,

thanks for the great package! I stumbled into a little bug (or desired behavior that isn't documented): if you specifiy an url with localhost, you will get an error.

Maybe the regex in the is_url function needs to be refitted? This comparison of url regexes might help https://mathiasbynens.be/demo/url-regex

Cheers!

library(httr)
library(polite)

polite_POST <- politely(httr::POST, verbose=TRUE) 
polite_POST(url = "http://localhost:3001/api/v1/document")

Error: I can't find an argument containing url. Aborting.

polite_0.1.2 httr_1.4.5 R version 4.2.2 (2022-10-31 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

fruchtblase avatar Mar 10 '23 13:03 fruchtblase