Giter VIP home page Giter VIP logo

Comments (14)

kbroman avatar kbroman commented on September 21, 2024

I'm getting this error from a call to POST()

Error: 'new_handle' is not an exported object from 'namespace:curl'

I guess from httr::handle().

from arxiv.

hadley avatar hadley commented on September 21, 2024

Did you update curl?

from arxiv.

kbroman avatar kbroman commented on September 21, 2024

Okay now I've got the dev version of curl, and I'm getting the error you're getting. Will investigate.

from arxiv.

kbroman avatar kbroman commented on September 21, 2024

Okay, I've figured out some problems, but it seems like there are a bunch more. 😦

Initial bit is that I was doing

httr::POST(query_url, body=list(search_query=query, id_list=possibly_null))

with the assumption that if possible_null were NULL then it would get dropped, which it no longer is.

from arxiv.

kbroman avatar kbroman commented on September 21, 2024

Hmm, actually that was the only problem. I'd just left some debug code in there. 😸

from arxiv.

kbroman avatar kbroman commented on September 21, 2024

Fixed in PR #26.

from arxiv.

hadley avatar hadley commented on September 21, 2024

That sounds like a bug in httr to me...

from arxiv.

sckott avatar sckott commented on September 21, 2024

ive noticed the same, that POST/etc. don't like it when body is NULL or an empty list

from arxiv.

hadley avatar hadley commented on September 21, 2024

@sckott this is new? (like as of ~3 hours ago)

from arxiv.

sckott avatar sckott commented on September 21, 2024

no, been happening a long time

from arxiv.

kbroman avatar kbroman commented on September 21, 2024

An example, for completeness.

This is okay:

httr::POST("http://export.arxiv.org/api/query",
            body=list(search_query='au:"Karl W. Broman"'))

This used to work but doesn't with the devel version of httr:

httr::POST("http://export.arxiv.org/api/query",
            body=list(search_query='au:"Karl W. Broman"', id_list=NULL))

from arxiv.

sckott avatar sckott commented on September 21, 2024

what I was talking about was if length(body) == 0 then POST would fail

from arxiv.

kbroman avatar kbroman commented on September 21, 2024

Hmm. Using NULL as the body actually works for me: gives status 200 and an appropriate response with 0 results.

z <- httr::POST("http://export.arxiv.org/api/query", body=NULL)
aRxiv::result2list(z)

When using list() as the body, however, httr::POST throws an error in line 47 of body.R

stopifnot(length(names(body)) > 0)

from arxiv.

hadley avatar hadley commented on September 21, 2024

Fixed in r-lib/httr@6d06ad5

The behaviour is now consistent with query params, and there's a better message if all the body parameters aren't named.

from arxiv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.