-
Notifications
You must be signed in to change notification settings - Fork 38
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
Allow the use of POST #89
Comments
Here is a work around I hacked together to upload ids. epost = function(db, id, config=NULL, ...) {
uri = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/epost.fcgi?"
args = list(..., email="david.winter@gmail.com",tool='rentrez')
body = list()
body$id = paste(id, collapse=",")
body$db = db
response <- httr::POST(uri, query=args, config=config, body=body, encode="form")
if(response$status_code >= 400) {
stop("Posting ids failed.")
}
response = httr::content(response, as="text", encoding="UTF-8")
record <- xmlTreeParse(response, useInternalNodes=TRUE)
result <- xpathApply(record, "/ePostResult/*", XML::xmlValue)
names(result) <- c("QueryKey", "WebEnv")
class(result) <- c("web_history", "list")
return(result)
} |
Hi @reedacartwright, Did the advice to use POST come from the NCBI? I was once discouraged from using POST (the http verb) and told to use epost (confusingly via GET). If the policy has changed I can incorporate something like this into the package. |
... actually, just as I say that, it seem POST is going to die (see email from NCBI in #86). |
It's in the epost documentation:
|
Hmmm, will email the help desk and see if they can confirm the right way to do this given the apparent end of support for POST mentioned in the other issue. |
Any updates on this issue? I think |
Hi @cstubben , I have emailed NCBI and will see what they think. If it something they are happy with then I'm very keen to include, but I also don't want to get offside with the people providing the API by doing something that (in some documents...) seems to be against their rules. |
The docs seem pretty clear to me, "if more than about 200 UIDs are to be provided, the request should be made using the HTTP POST method". I think most rentrez users are violating this and GETting more than 200 ids. |
NCBI got back and said POST will be supported in the future, so we are now using POST for requests > 200 Will keep #89 open until there are tests for this.
Includes tests for #89, updates to NEWS and DESCRIPTION to note new release
Hi @reedacartwright and @cstubben , The NCBI is going to be supporting POST, so from now on devtools::install_github("ropensci/rentrez", ref="develop") |
NCBI recommends the use of POST if the number of ids is greater than 200. Right now rentrez always uses GET.
The text was updated successfully, but these errors were encountered: