擅长:python、mysql、java
<p>结果我错过了标题信息。以下工作:</p>
<pre><code>url = "http://localhost:8080"
data = {'sender': 'Alice', 'receiver': 'Bob', 'message': 'We did it!'}
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url, data=json.dumps(data), headers=headers)
</code></pre>