Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload zip file using REST API using httr::PUT request in R #643

Closed
string09 opened this issue Apr 22, 2020 · 1 comment
Closed

upload zip file using REST API using httr::PUT request in R #643

string09 opened this issue Apr 22, 2020 · 1 comment

Comments

@string09
Copy link

I have zip file which contain folders and inside those folders - files are there. Through POSTMAN zip file gets uploaded in milliseconds. In Body for Postman - "form-data"

But same thing I am trying to execute using R programming httr::PUT request, I am getting below error :

Error in curl::curl_fetch_memory(url, handle = handle) : transfer closed with 163 bytes remaining to read

# code
localFilePath <-
paste0(getwd(), "/TestFolder_2020-04-02 19-28.zip")

upload.response <-
httr::PUT(
URLencode(
  "https://API/UUID/Shapes"
),
add_headers(
  .headers = c("Token" = "*************",
               "Content-Type" = "application/json")
),
body = list(uploadFile = upload_file(localFilePath)),
encode = "multipart"
)
@string09 string09 reopened this Apr 22, 2020
@hadley
Copy link
Member

hadley commented Oct 31, 2023

httr has been superseded in favour of httr2, so is no longer under active development. If this problem is still important to you in httr2, I'd suggest filing an issue offer there 😄. Thanks for using httr!

@hadley hadley closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants