linux - How to Post Url in data of a curl request -


i trying post 2 parameters using curl.
path , filename

curl --request post 'http://localhost/service' --data "path='/xyz/pqr/test/'&filename='1.doc'" 

i know wrong in this.
have use urlencode. tried many things still no luck.
please give example how can post url in data of curl request.

perhaps don't have include single quotes:

curl --request post 'http://localhost/service' --data "path=/xyz/pqr/test/&filename=1.doc" 

update: reading curl's manual, separate both fields 2 --data:

curl --request post 'http://localhost/service' --data "path=/xyz/pqr/test/" --data "filename=1.doc" 

you try --data-binary:

curl --request post 'http://localhost/service' --data-binary "path=/xyz/pqr/test/" --data-binary "filename=1.doc" 

and --data-urlencode:

curl --request post 'http://localhost/service' --data-urlencode "path=/xyz/pqr/test/" --data-urlencode "filename=1.doc" 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -