requests module : post data to remote host, wrong value is sent
<p>I have string  like:</p>

<pre><code>{
    'singleQuesResponses': {
        '28': '',
        '14': '',
        '27': '',
        '26': ''
    },
    'org_apache_struts_taglib_html_TOKEN': 'a1553f25303435076412b5ca7299b936',
    'quesResponses': {
        'some': 'data'
    }
}
</code></pre>

<p>when i post it in pyhton requests like:</p>

<pre><code>data = json.loads(data)
page = requests.post('http://localhost/chilivery/index.php', data=data, cookies=bcookies)
</code></pre>

<p>then value that post is something like this:</p>

<pre><code>array(3) { ["quesResponses"]=&gt; string(4) "some" ["singleQuesResponses"]=&gt; string(2) "14" ["org_apache_struts_taglib_html_TOKEN"]=&gt; string(32) "a1553f25303435076412b5ca7299b936" }
</code></pre>

<p>but i expect:</p>

<pre><code>array(3) { ["quesResponses"]=&gt; array["some"=&gt;'data'] ["singleQuesResponses"]=&gt; string(2) "14" ["org_apache_struts_taglib_html_TOKEN"]=&gt; string(32) "a1553f25303435076412b5ca7299b936" }
</code></pre>

<p>I mean why 'some' is not sent by value as array and the only first key of it send as a string ?</p>

<p>In this case, only way is sending your data with <code>Get</code> instead of posting them with data; you can use params in requests module.</p>

python