Skip to content

Request body is omitted from POST requests in Next.js #2111

Open
@corydeppen

Description

@corydeppen

openapi-fetch version

0.13.4

Description

I'm trying to use openapi-fetch in a Next.js 14 app and I've noticed the body is being omitted from POST requests made from within server functions and RSCs. Specifically, prior to calling new CustomRequest(), requestInit.body contains the expected serialized/stringified object, however it's missing from the request instance that's created.

Admittedly, I haven't tried this in a different framework yet, so I'm not entirely sure whether this could be related to Next.js at this point. I just wanted to include that context in case it helps.

Reproduction

Make a POST request from a server function or RSC and observe the API request will be made without a body.

Expected result

Fetch requests containing a body that are made via openapi-fetch should pass the serialized data to the API as a standard fetch request would.

Extra

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions