Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

What is the correct way to structure the payload for a POST request to create a new document?

default discord avatar
juliandm19952 years ago
3

What is the correct way to structure the payload for a POST request to "

http://localhost:3200/api/programas

" in order to create a new document that only includes a {title: string}? The document is created, but all its fields are empty.

  • default discord avatar
    notchr2 years ago
    @410868850712903681

    Did you include title in your post body?

  • default discord avatar
    juliandm19952 years ago

    I tried {title: “my title”} in the body



    The document is created but no title is included

  • discord user avatar
    denolfe
    2 years ago

    Do you have the code you used to do the POST?



    A nice way to see body structure is to do the operation in the admin panel with your browser network tab open.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.