Running examples in ‘crul-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: post-requests
> ### Title: HTTP POST/PUT/PATCH requests
> ### Aliases: post-requests
> 
> ### ** Examples
> 
> (x <- HttpClient$new(url = "https://httpbin.org"))
<crul connection> 
  url: https://httpbin.org
  curl options: 
  proxies: 
  auth: 
  headers: 
> 
> # POST requests
> ## a list
> (res_post <- x$post('post', body = list(hello = "world"), verbose = TRUE))
* Found bundle for host httpbin.org: 0x55a625672a00 [can pipeline]
* Re-using existing connection! (#1) with host httpbin.org
* Connected to httpbin.org (50.16.214.206) port 443 (#1)
> POST /post HTTP/1.1
Host: httpbin.org
Accept: */*
User-Agent: libcurl/7.52.1 r-curl/2.7 crul/0.3.8
Accept-Encoding: gzip, deflate
Content-Length: 145
Expect: 100-continue
Content-Type: multipart/form-data; boundary=------------------------1fcc9bf56ff534f5

* Done waiting for 100-continue
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Connection: keep-alive
< Server: meinheld/0.6.1
< Date: Mon, 03 Jul 2017 05:48:27 GMT
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< X-Powered-By: Flask
< X-Processed-Time: 0.000969886779785
< Content-Length: 526
< Via: 1.1 vegur
< 
* Curl_http_done: called premature == 0
* Connection #1 to host httpbin.org left intact
<crul response> 
  url: https://httpbin.org/post
  request_headers: 
    User-Agent: libcurl/7.52.1 r-curl/2.7 crul/0.3.8
    Accept-Encoding: gzip, deflate
  response_headers: 
    status: HTTP/1.1 200 OK
    connection: keep-alive
    server: meinheld/0.6.1
    date: Mon, 03 Jul 2017 05:48:27 GMT
    content-type: application/json
    access-control-allow-origin: *
    access-control-allow-credentials: true
    x-powered-by: Flask
    x-processed-time: 0.000969886779785
    content-length: 526
    via: 1.1 vegur
  status: 200
> 
> ## a string
> (res_post <- x$post('post', body = "hello world", verbose = TRUE))
* Found bundle for host httpbin.org: 0x55a625672a00 [can pipeline]
* Re-using existing connection! (#1) with host httpbin.org
* Connected to httpbin.org (50.16.214.206) port 443 (#1)
> POST /post HTTP/1.1
Host: httpbin.org
Accept: */*
User-Agent: libcurl/7.52.1 r-curl/2.7 crul/0.3.8
Accept-Encoding: gzip, deflate
Content-Length: 11
Content-Type: application/x-www-form-urlencoded

* upload completely sent off: 11 out of 11 bytes
< HTTP/1.1 200 OK
< Connection: keep-alive
< Server: meinheld/0.6.1
< Date: Mon, 03 Jul 2017 05:48:27 GMT
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< X-Powered-By: Flask
< X-Processed-Time: 0.00095009803772
< Content-Length: 458
< Via: 1.1 vegur
< 
* Curl_http_done: called premature == 0
* Connection #1 to host httpbin.org left intact
<crul response> 
  url: https://httpbin.org/post
  request_headers: 
    User-Agent: libcurl/7.52.1 r-curl/2.7 crul/0.3.8
    Accept-Encoding: gzip, deflate
  response_headers: 
    status: HTTP/1.1 200 OK
    connection: keep-alive
    server: meinheld/0.6.1
    date: Mon, 03 Jul 2017 05:48:27 GMT
    content-type: application/json
    access-control-allow-origin: *
    access-control-allow-credentials: true
    x-powered-by: Flask
    x-processed-time: 0.00095009803772
    content-length: 458
    via: 1.1 vegur
  status: 200
> 
> ## empty body request
> x$post('post')
<crul response> 
  url: https://httpbin.org/post
  request_headers: 
    User-Agent: libcurl/7.52.1 r-curl/2.7 crul/0.3.8
    Accept-Encoding: gzip, deflate
  response_headers: 
    status: HTTP/1.1 200 OK
    connection: keep-alive
    server: meinheld/0.6.1
    date: Mon, 03 Jul 2017 05:48:27 GMT
    content-type: application/json
    access-control-allow-origin: *
    access-control-allow-credentials: true
    x-powered-by: Flask
    x-processed-time: 0.00082802772522
    content-length: 432
    via: 1.1 vegur
  status: 200
> 
> ## form requests
> ## Not run: 
> ##D (cli <- HttpClient$new(
> ##D   url = "http://apps.kew.org/wcsp/advsearch.do"
> ##D ))
> ##D cli$post(
> ##D   encode = "form",
> ##D   body = list(
> ##D     page = 'advancedSearch',
> ##D     genus = 'Gagea',
> ##D     species = 'pratensis',
> ##D     selectedLevel = 'cont'
> ##D   )
> ##D )
> ## End(Not run)
> 
> (x <- HttpClient$new(url = "https://httpbin.org"))
<crul connection> 
  url: https://httpbin.org
  curl options: 
  proxies: 
  auth: 
  headers: 
> res <- x$post("post",
+   encode = "json",
+   body = list(
+     genus = 'Gagea',
+     species = 'pratensis'
+   )
+ )
> jsonlite::fromJSON(res$parse())
No encoding supplied: defaulting to UTF-8.
Error: lexical error: invalid char in json text.
                                       <html><head><title>Request Time
                     (right here) ------^
Execution halted