Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

"MISSING_ARGUMENTS: image_url, image_file, image_base64" error when supplying file to Face::detect() #6

Open
yquan opened this issue Nov 22, 2018 · 0 comments

Comments

@yquan
Copy link

yquan commented Nov 22, 2018

according to API doc, when use image_file, it should be using POST multipart/form-data:

The binary data of the image, uploaded via POST multipart/form-data.

however, the Face\Providers\BaseProvider::request() seems not treating this way:

/**
 * Multipart/form-data request.
 *
 * @param string $method
 * @param string $resource
 * @param array  $params
 * @param array  $headers
 *
 * @return array
 */
protected function request($method, $resource, $params = [], $headers = [])
{
    return $this->buildRequest($method, $resource, [
        'form_params' => $this->buildRequestParams($params),
        'headers' => $headers,
    ]);
}

according to guzzle doc: http://docs.guzzlephp.org/en/stable/request-options.html#multipart

multipart cannot be used with the form_params option. You will need to use one or the other. Use form_params for application/x-www-form-urlencoded requests, and multipart for multipart/form-data requests.

This option cannot be used with body, form_params, or json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant