Sabine, you have double double quotes in your post data. If you use single quotes on the commandline the content is not interpreted and you are sending "" and that is not valid.
Norbert > Am 05.03.2015 um 18:59 schrieb Sabine Manaa <manaa.sab...@gmail.com>: > > Hi , > > I want to write the following command in pharo: > > "curl -v -X POST --data '{""email"":""m...@gmail.com"", > ""password"":""geheim""}' -H 'Content-Type: application/json' -H 'Accept: > application/json' -H 'Authorization: BEARER > d0ae3333-eaad-4335-a64b-8903470baa9f' 'https://user.gini.net/api/users'" > > The following does not work, response is > 415 Unsupported Media Type text/html;charset=UTF-8 2341B > And I assume that it is the "--data {}" part, which is wrong. > > ^ZnClient new > systemPolicy ; > https; > host: 'user.gini.net'; > path: 'api/users'; > headerAt: 'Content-Type' add: 'application/json'; > headerAt: 'Authorization' add: ('BEARER {1}' format: {self > getAccessToken}); > headerAt: 'Accept' add: 'application/json'; > contents:'--data {"email":"m...@gmail.com", > "password":"geheim"} '; > post. > > how can I put the --data part into the request? > > Regards > Sabine > > > > -- > View this message in context: > http://forum.world.st/ZnClient-data-tp4809798.html > Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com. >