JoeDog / siege

Siege is an http load tester and benchmarking utility
GNU General Public License v3.0
5.91k stars 386 forks source link

siege escapes JSON when given in urls.txt #146

Closed eratohr closed 5 years ago

eratohr commented 5 years ago

Unlike when it is given in command line, JSON is escaped when given in urls.txt which causes problems with backends expecting clean json via "application/json" content type.

command line example: siege --content-type="application/json" -c 1 -d 1 -i -t 5m -v -p -f urls.txt

urls.txt: https://domain.com POST {"filter": "some_filter"}

Gives printed output as:

POST / HTTP/1.0
Host: domain.com
Accept: */*
Accept-Encoding: gzip;deflate
User-Agent: Mozilla/5.0 (apple-x86_64-darwin17.0.0) Siege/4.0.4
Connection: close
Content-type: application/json

'{"filter": "some_filter"}'

unlike when run from command line like this: siege --content-type="application/json" -c 1 -d 1 -i -t 5m -v -p 'https://domain.com POST {"filter":"some filter"}'

gives output:

POST / HTTP/1.0
Host: domain.com
Accept: */*
Accept-Encoding: gzip;deflate
User-Agent: Mozilla/5.0 (apple-x86_64-darwin17.0.0) Siege/4.0.4
Connection: close
Content-type: application/json

{"filter": "some_filter"}

(no quotes around json)

Help is appreciated. Thanks, Eduard

eratohr commented 5 years ago

This is false, ignore.