Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3663

How can I access the body from HTTP delete in Flask?

$
0
0

I have this method in my Flask WEB API, that receive a list of IDs.

@app.route("/delete_item", methods=['DELETE'])def delete_item():    items = request.get_json()    print(items)    my_class.delete(items)    return make_response()

When I call this method, the request.get_json() return None.I am calling it using AngularJS, as bellow:

var data = ['0', '1'. '2']$http.delete('base_url/delete_item', {data});

How can I access the body in delete http request?The others methods (GET, PUT and POST) are working well.


Viewing all articles
Browse latest Browse all 3663

Trending Articles