Examples for 'curl::curl_echo'


Echo Service

Aliases: curl_echo find_port

Keywords:

### ** Examples

if(require('httpuv')){
h <- new_handle(url = 'https://hb.cran.dev/post')
handle_setform(h, foo = "blabla", bar = charToRaw("test"),
  myfile = form_file(system.file("DESCRIPTION"), "text/description"))

# Echo the POST request data
formdata <- curl_echo(h)

# Show the multipart body
cat(rawToChar(formdata$body))

# Parse multipart
webutils::parse_http(formdata$body, formdata$content_type)
}
Loading required package: httpuv
--------------------------e024f822e5c5915c
Content-Disposition: form-data; name="foo"

blabla
--------------------------e024f822e5c5915c
Content-Disposition: form-data; name="bar"

test
--------------------------e024f822e5c5915c
Content-Disposition: form-data; name="myfile"; filename="DESCRIPTION"
Content-Type: text/description

Package: base
Version: 4.2.3
Priority: base
Title: The R Base Package
Author: R Core Team and contributors worldwide
Maintainer: R Core Team <do-use-Contact-address@r-project.org>
Contact: R-help mailing list <r-help@r-project.org>
Description: Base R functions.
License: Part of R 4.2.3
Suggests: methods
Built: R 4.2.3; ; 2024-11-28 07:27:45 UTC; unix

--------------------------e024f822e5c5915c--
Error in loadNamespace(x): there is no package called 'webutils'

[Package curl version 5.2.3 Index]