how can I create a URL/site to send a HTTP 204 or HTTP 403 response?

189 views Asked by At

I'm trying to create an app with a login page to POST to a url and return a status code. For now the app is to call a URL that returns a HTTP 204 or HTTP 403 response. How is this done? Do I need to create/implement a servlet?

2

There are 2 answers

0
matcha On BEST ANSWER

Created a servlet using Maven/Eclipse/Tomcat and used HttpServletResponse

0
ntsh On

You certainly can implement your own web service to return those HTTP responses.

For testing your app you can use services like httpbin.org

For example: To get a 403 response, simply send a request to http://httpbin.org/status/403