python - How do I build a complex filter for Flask-Restless when using Requests? -


i want make complex query flask-restless api using requests. not sure how build following query examples requests. how make query?

get /api/person?q={"filters":[{"name":"age","op":"ge","val":10}]} http/1.1 host: example.com 

flask-restless expects query string in json format. example given dictionary list of filters, each filter being dictionary. build query structure, dump json, make query requests.

import json q = {'filters': [{'name': 'age', 'op': 'ge', 'val': 10}]} r = requests.get('http://example.com', params={'q': json.dumps(q)}) 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -