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

File upload POST request #36

Open
aschmidt1976 opened this issue Jun 15, 2016 · 1 comment
Open

File upload POST request #36

aschmidt1976 opened this issue Jun 15, 2016 · 1 comment

Comments

@aschmidt1976
Copy link

aschmidt1976 commented Jun 15, 2016

Hi,
I need to send file data from a Symfony2 web to an external REST API Resource (Gallery3 REST API).
I absolutely do net get it how to embed files in a POST request. Is it possible with CiRestClientBundle? If yes, please update the documentation. Would be nice if there was a code example. For me, it's not clear what "somePayload" should look like in case of file upload.

What I already have is a working POST request without files:

$response = $restClient->post(
  'http://192.168.xxx.xxx/rest/item/1',
  'entity={"type":"album","name":"My new photo album","title":"My new photo album"}',
  array(
    CURLOPT_HTTPHEADER => array('X-Gallery-Request-Method: post', 'X-Gallery-Request-Key: '.urlencode($authToken)),
  )
);
@TobiasHauck
Copy link
Member

Hey,
thanks for reporting and sorry for being so late.

Actually it's not possible, but we should support it as file uploads are daily business. May you be so kind to work on that issue and open a PR? Would be great ;)

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