6👍
@jacobm654321,
for sure, the best thing to do is encode the URL programmatically. But my problem wasn’t that. My problem is that the file containing the post data had a blank line at end of file. EditorConfig put it there. After remove that blank line, everything worked well.
Thanks anyway.
29👍
File must have a properly url-encode data. If you url-encode manually, it is too easy to have typos like blanks wrong encodes. Best do it programmatically.
See an another answer: Apache Bench and POST data
on how to use Python to create such file ( ex: post.data)
Then use:
ab -T 'application/x-www-form-urlencoded' -n 10 -p post.data http://localhost:8080/
- [Django]-Indexing JSONField in Django PostgreSQL
- [Django]-Django – Annotate multiple fields from a Subquery
- [Django]-Django ManyToManyField and on_delete
10👍
When using ab, the entire contents of the data file must be wrapped onto a single line – it fails silently if it’s normally expanded JSON. So a post from a data file that works fine with curl will fail with ab until you do this.
Tip: If using Atom or VSCode, select all and hit Cmd-J to wrap everything to one line.
- [Django]-How to create an empty queryset and to add objects manually in django
- [Django]-Django-tables2: How to use accessor to bring in foreign columns?
- [Django]-Django Debug Toolbar: understanding the time panel