Skip to content

Latest commit

 

History

History

post_request

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Handle a POST Request

This example demonstrates how to handle POST requests in Deno Deploy.

Deploy this example

Try Live Version

The example is deployed at https://post.deno.dev for demo.

A POST request with JSON body:

curl -X POST \
 -H 'content-type: application/json' \
 -d '{ "name": "Deno" }' https://post.deno.dev

Response:

{
  "json": {
    "name": "Deno"
  }
}

A POST request with form data:

curl -X POST -F 'name=Deno' https://post.deno.dev

Response:

{
  "form": {
    "name": "Deno"
  }
}

Run Offline

You can run the example program on your machine using deno:

deno run https://raw.githubusercontent.com/denoland/deploy_examples/main/post_request/mod.js