0

I am working on an integration with a SaaS application. We have to use CURL call which will accept input parameters in JSON. This also has filename parameter. This filename is generated from other previous call. This CURL should download the file. I tried using

curl -k -c -XGET -H '{"type":"download","credentials":{"partnerUserID":"aa_com","partnerUserSecret":"abce314334c27e431"},"fileName":"export019cdbea-5c50-4861.csv"}' "https://integrations.saas.com/Integration-Server/EIntegrations/" 

curl -d '{"type":"download","credentials":{"partnerUserID":"aa_com","partnerUserSecret":"abce31801"},"fileName":"export019cdbea-5c50-4e1.csv"}' -X GET https://integrations.saas.com/Integration-Server/EIntegrations/

I am getting the following error

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
 <title>400 - Bad Request</title>
 </head>
 <body>
 <h1>400 - Bad Request</h1>
 </body>
 </html>
Daniel
  • 197
  • 2
  • 16
Mike
  • 21
  • 2
  • Surrounding single quotes for JSON won't do on Windows, reverse internal double to single quotes in JSON string. – Petr Abdulin Feb 20 '15 at 06:13
  • I am running the above curl on linux server – Mike Feb 20 '15 at 06:19
  • You also missing `-H "Content-Type: application/json"` for content type header. – Petr Abdulin Feb 20 '15 at 06:23
  • possible duplicate of [How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?](http://stackoverflow.com/questions/7172784/how-to-post-json-data-with-curl-from-terminal-commandline-to-test-spring-rest) – Petr Abdulin Feb 20 '15 at 06:23
  • how to pass more than one parameter. I have one JSON input and other template input (.ftl file). – Mike Feb 24 '15 at 00:26

0 Answers0