Niazipan
Niazipan

Reputation: 1037

POST request to node.js script running locally

This is probably a really basic question.

I'm new to node.js.

I'm writing a script which receives an HTTP POST request. I'm going to be deploying to Heroku, but while I'm testing locally how do I make POST requests to the script?

Thanks.

Upvotes: 1

Views: 223

Answers (2)

slebetman
slebetman

Reputation: 114014

  1. If you're on unix (OSX, Linux, BSD) or have an environment where you can download/use unix tools (cygwin, git bash) you can use curl:

    curl -XPOST http://localhost/my/app -d 'data you want to post'
    
  2. If you're using Google Chrome or you're on a Mac install Postman

Upvotes: 1

Madhu Magar
Madhu Magar

Reputation: 445

You can use chrome extension called postman.

Upvotes: 1

Related Questions