Web service that returns any http status code you specify for API testing purposes?
A few months ago I remember reading about a useful little web service somebody put together for API testing purposes. Basically, you just did a call like this, e.g.:
http://www.someAPItestingtool.com/status/405
And the server would respond with a 405 / Method Not Allowed
.
It was basically just a handy little utility you could use during development if you just wanted to interact with a live URL that behaved the way you specified.
My google-fu is weak today and I cannot for the life of me remember what it was called. I'm sure I could whip something like this up myself in about as long as its taken me to type this question, but if anybody remembers what I'm talking about, perhaps you can share?
Many thanks...
Edit: Posted something I whipped up real quick, but I'd still be interested in the answer if someone knows what I'm referring to...开发者_运维百科
Over a year later, I at last re-stumbled upon the service I was thinking about:
http://httpstat.us/
I'm still quite positive someone put something like this together, but it was quicker for me to just whip up something using Flask:
from flask import Flask, make_response
app = Flask(__name__)
@app.route('/<int:status_code>')
def return_status(status_code):
response = make_response()
response.status_code = status_code
response.data = response.status
return response
if __name__ == '__main__':
app.run()
精彩评论