Git Product home page Git Product logo

crul's Issues

Documentation not clear about optional parameters for authentificatio

In the documentation about crul::auth() is said to have all its argument optional.

However, crul::auth(auth = "any) send back an error

Error in assert(user, "character") : 
  argument "user" is missing, with no default

it is because crul:::make_up does a check abour argument user and pwd which should not be empty

make_up <- function (user, pwd) 
{
  assert(user, "character")
  assert(pwd, "character")
  if (!is.null(user) || !is.null(pwd)) {
    return(paste0(user, ":", pwd))
  }
  NULL
}

It seems that it is expected to be set to NULL considering the code above the the crul:::cpp function.
I check : with auth(user = NULL, pwd = NULL, auth = "any") it is working.

It could be useful if this is explained in the documentation help page or maybe if the arguments are set to NULL by default.

Either way, I can help with a PR if you want to change thing

get/set cookie?

Hi,

I have a use case where I need to set up cookie value when running GET/POST method (for a tmp authentication purpose). Is there a way to do so in this package?

Set custom user agent and proxy

Hi.

Many thanks for the nice package.

How can I set a some custom options for the requests? For example user agent and proxy server.

Async response objects sometimes point to wrong requests objects

When making async requests, responses come back unordered which is fine. However it seems like the associated request objects accessible via $request are always ordered in the original way.

This means that in case responses do not come back in the same order as the original requests, the associated request of the respective response might be wrong.

Here is a minimal example that sometimes works and sometimes not:

library(crul)
(cc <- Async$new(
  urls = c(
    'https://httpbin.org/get?a=5',
    'https://httpbin.org/get?a=5&b=6',
    'https://httpbin.org/ip'
  )
))
(res <- cc$get())

# the following line prints all urls of the original request object
print(sapply(res, function(x) x$request$url))
# this prints all response urls
print(sapply(res, function(x) x$url))
# those two values should be equal I assume
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin16.5.0 (64-bit)
Running under: macOS Sierra 10.12.5

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] crul_0.3.6

loaded via a namespace (and not attached):
 [1] compiler_3.4.0  R6_2.2.1        tools_3.4.0     withr_1.0.2    
 [5] rstudioapi_0.6  curl_2.6        memoise_1.1.0   Rcpp_0.12.11   
 [9] urltools_1.6.0  triebeard_0.3.0 digest_0.6.12   devtools_1.13.1

set curl options globally

main use case is when using crul inside a package, becomes esp. important when e.g., a pkg foo uses crul, then another pkg bar uses foo, which makes likelihood of arg. collisions more likely

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.