python - Sending structured form data in an HTTP POST -


i'm adapting graphql query restful api. code handling part of django app. idea pass request along back-end microserver instead of handling request in django. simplifying bit, query's arguments (in graphql's query language) like:

pattern string address addressinput dist float distunit string 

where addressinput is:

lines string[] city string district string division string country string postalcode string 

so server ends seeing arguments python dict, e.g.

{   'dist': 1,   'distunit': 'mi',   'address': {      'lines': ['123 main st.'],      'city': 'genericville',      'division': 'ia',      'country': 'us'    } } 

how put http form in http request? like:

form = querydict(mutable=true) form['dist'] = [1] form['distunit'] = ['mi'] form['address.lines'] = ['123 main st.'] form['address.city'] = ['genericville'] form['address.division'] = ['ia'] form['address.country'] = ['us'] 

and process accordingly on server, there way that's less of kludge handle this?


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -