supersamples icon indicating copy to clipboard operation
supersamples copied to clipboard

curl output not following type("form")

Open littlexiang opened this issue 9 years ago • 3 comments

post requests in form type got a json string curl payload output

littlexiang avatar Nov 05 '15 06:11 littlexiang

utils.api.post('/path/to')
                .type("form")
                .send(utils.data.iOSApp)
                .send({token: new_user_platform.token})
                .send({
                    'email': new_user_email.user.email,
                    'password': utils.DEFAULT_PASSWORD
                })
curl -X POST -H "content-type: application/x-www-form-urlencoded" -H "content-length: 141" -d '{"mobile":"18657072366","password":"password","nickname":"test1-4kg73vV7Gg","verifycode":"1179527","phonecode":"86","countrycode":"CN","v":"i6.5.0","vc":"AppStore","vd":"ABCDEFG"}' "http://10.1.14.251/path/to"

littlexiang avatar Nov 05 '15 06:11 littlexiang

Thanks, I wasn't aware of type('form'). Does this set a content-type: application/x-www-form-urlencoded header?

rprieto avatar Nov 05 '15 07:11 rprieto

yes it is the http header part is correct

littlexiang avatar Nov 05 '15 07:11 littlexiang