Httr disable "Wait: 100-continue"
I am trying to send json to bosun in R using httr::POST
.
Enabled set_config(verbose())
and I saw the header: Expect: 100-continue
which might cause a jetty error.
Command:
response <- httr::POST(url = "http://192.168.65.1:8070/api/put?details",
body = json_str,
add_headers("Content-Type" = "application/json; charset=UTF-8"))
Detailed shows:
-> POST http://192.168.65.1:8070/api/put?details HTTP/1.1
-> User-Agent: curl/7.35.0 Rcurl/1.96.0 httr/0.6.0
-> Host: 192.168.65.1:8070
-> Accept: */*
-> Accept-Encoding: gzip
-> Proxy-Connection: Keep-Alive
-> Content-Type: application/json; charset=UTF-8
-> Content-Length: 1
-> Expect: 100-continue
How do I turn off the title Expect: 100-continue
?
Here is mine sessionInfo()
:
R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=C LC_COLLATE=C
[5] LC_MONETARY=C LC_MESSAGES=C LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RJSONIO_1.3-0 httr_0.6.0 RCurl_1.96-0
loaded via a namespace (and not attached):
[1] bitops_1.0-6 stringr_0.6.2 tools_3.1.2
+3
source to share