0

I am developing a server. I want to prevent all Http get events and some post events. I just allow some post event (/users,/login,/signup...) and I use node.js...

2
  • 3
    Just don't include any get method in your code. Commented Aug 6, 2015 at 2:10
  • 1
    you can use request.method on the incoming request obj to see what HTTP method was used (nodejs.org/api/http.html#http_message_method). also, check out the restify library. Commented Aug 6, 2015 at 3:13

1 Answer 1

1

Create necessary post endpoint and handle other request as error, and provide message that method is not allowed.

Request Denied!!!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.