-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Labels
Milestone
Description
I am trying to upload file with httr2 to S3 with custom endpoint (so have problems using aws.s3 package, so making it with httr2). While constructing request I found that cant overide Host header with req_headers() function, it always matches to base url, provided with request() function.
resp <- request(s3baseurl) %>%
req_method("PUT") %>%
req_body_file(path = file) %>%
req_headers(
"Host" = paste0(bucket, ".storage.example.com"),
"Date" = dateValue,
"ContentType" = contentType,
"Authorization" = paste0("AWS ", s3_key_id, ":", signature)) %>%
req_dry_run()
Output:
PUT / HTTP/1.1
Host: example.com
User-Agent: httr2/1.0.5 r-curl/5.2.3 libcurl/8.10.1
Accept: */*
Accept-Encoding: deflate, gzip, br, zstd
Date: Mon, 14 Oct 2024 17:24:29 +0300
ContentType: text/xml
Authorization: AWS YCAJEsP-XW0vHQNghKS2t68GK:XZHHgch9Qbm1u6pVsQv8HpjtPMI=
Content-Length: 38922
38922 bytes of binary data
Is there are some way to change Host header with httr2?