Skip to content

Commit adf8696

Browse files
committed
Add user-agent to go in polite pool of xref API requests
1 parent 24d38a9 commit adf8696

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/GetBibEntryWithDOI.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ GetBibEntryWithDOI <- function(doi, temp.file=tempfile(fileext = '.bib'),
3838
for (i in seq_along(doi)){
3939
temp <- GET(modify_url('https://doi.org/', path = doi[i]),
4040
config = list(followlocation = TRUE),
41-
add_headers(Accept = "application/x-bibtex"))
41+
add_headers(Accept = "application/x-bibtex",
42+
"User-Agent" = "mailto:[email protected]"))
4243
if (!http_error(temp)){
4344
temp <- content(temp, as = "text", encoding = "UTF-8")
4445
successes[i] <- TRUE

0 commit comments

Comments
 (0)