Skip to content

Create multipart/form-data requests? #985

@Lindstromer

Description

@Lindstromer

I'm having issues creating a request with an attached file. Tried a lot of different alternatives but always end up with issues.

Seems like Guzzle in itself handles this, but the oauth2-client is limiting the getAuthenticatedRequest method to using only " Any of "headers", "body", and "protocolVersion".".

Example where it says to not specify form-data:
https://stackoverflow.com/questions/47550801/multiple-files-uploaded-via-guzzle-multipart-form-data-request-are-not-recognize

Another discussion regarding this, I tried following it but cannot get it to work. Guzzle complains about it being an invalid resource type "array" while doing so:
https://stackoverflow.com/questions/58736361/replicate-curl-multipart-form-data-request-with-guzzle-league-oauth2-client?rq=1

Error is thrown in the streamFor method found in Utils.php located in guzzlehttp vendor/psr7/src/Utils.php.

Anyone tried this and got it to work? Any help would be very appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions