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

default discord avatar
JulianDM1995
2 months ago
5

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
    thisisnotchris
    2 months ago

    @JulianDM1995 Did you include title in your post body?

  • default discord avatar
    JulianDM1995
    2 months ago

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



    The document is created but no title is included

  • discord user avatar
    denolfe
    Payload Team
    2 months 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.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.