Upload image with POST request in R
up vote
0
down vote
favorite
I am trying to send POST request to following API: https://2captcha.com/2captcha-api (look at normal captcha).
Here is my code
library(httr)
captcha_apth <- paste0("my_image_path.jpeg")
output <- httr::POST(
url = api_url,
body = list(key = api_key, method = "post", file = httr::upload_file(captcha_apth)),
encoding = "multipart",
)
but it returns an error:
ERROR_ZERO_CAPTCHA_FILESIZE
It seems like it doesn't upload the image, but I can't figure out why?
r post httr
add a comment |
up vote
0
down vote
favorite
I am trying to send POST request to following API: https://2captcha.com/2captcha-api (look at normal captcha).
Here is my code
library(httr)
captcha_apth <- paste0("my_image_path.jpeg")
output <- httr::POST(
url = api_url,
body = list(key = api_key, method = "post", file = httr::upload_file(captcha_apth)),
encoding = "multipart",
)
but it returns an error:
ERROR_ZERO_CAPTCHA_FILESIZE
It seems like it doesn't upload the image, but I can't figure out why?
r post httr
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to send POST request to following API: https://2captcha.com/2captcha-api (look at normal captcha).
Here is my code
library(httr)
captcha_apth <- paste0("my_image_path.jpeg")
output <- httr::POST(
url = api_url,
body = list(key = api_key, method = "post", file = httr::upload_file(captcha_apth)),
encoding = "multipart",
)
but it returns an error:
ERROR_ZERO_CAPTCHA_FILESIZE
It seems like it doesn't upload the image, but I can't figure out why?
r post httr
I am trying to send POST request to following API: https://2captcha.com/2captcha-api (look at normal captcha).
Here is my code
library(httr)
captcha_apth <- paste0("my_image_path.jpeg")
output <- httr::POST(
url = api_url,
body = list(key = api_key, method = "post", file = httr::upload_file(captcha_apth)),
encoding = "multipart",
)
but it returns an error:
ERROR_ZERO_CAPTCHA_FILESIZE
It seems like it doesn't upload the image, but I can't figure out why?
r post httr
r post httr
asked Nov 7 at 19:17
Mislav
421317
421317
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53196313%2fupload-image-with-post-request-in-r%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown