I have a problem sending JSON via curl from cmd (Windows7) to Flask RESTful. Here is what I post:
curl.exe -i -H "Content-Type: application/json" \ -H "Accept: application/json" -X POST \ -d '{"Hello":"Karl"}' http://example.net:5000/
This leads to bad requests, also I donโt know how to debug this, usually I print information to the console, but it doesnโt work. How do you debug wsgi applications? It seems like a hopeless task ...
This is my simple test application, as shown on the net:
from flask import Flask, request from flask.ext.restful import Resource, Api app = Flask(__name__) api = Api(app) class Test(Resource): def post(self):
json python rest flask curl
neonbarbarian
source share