Skip to content

File upload POST request #36

@aschmidt1976

Description

@aschmidt1976

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)),
  )
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions