7 Replies Latest reply on Mar 8, 2013 11:52 AM by jiang84

    CURL POST with vCO 5.1 REST API

    jiang84 Novice

      I am trying to invoke a vco workflow by using the 5.1 REST API through curl. I could do GET without any issue; but POST always gives me the 400 bad request error below. I want to use json instead of xml, so I passed in "Content-Type: application/json". I am using windows curl.


      Initially I also  tried to create a file with json parameters with "-d @filename"; it gives the same error.


      Could someone point out what is wrong with my syntax? thanks.


      curl -i -k --user vcoadmin:vcoadmin -X POST -H "Content-Type:application/json"
      3-4e32-8825-3e77ef31c4d7/presentation/instances -d '{}'

      HTTP/1.1 400 Bad Request
      Content-Type: text/html;charset=utf-8

      Content-Length: 965
      Date: Tue, 05 Mar 2013 02:31:19 GMT
      Connection: close
      Server: vCO Server


      <html><head><title>JBossWeb/2.0.1.GA - Error report</title><style><!--H1 {font-f
      x;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76
      ;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background
      -color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:
      black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:whit
      e;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:w
      hite;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {co
      lor : #525D76;}--></style> </head><body><h1>HTTP Status 400 - </h1><HR size="1"
      noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><
      p><b>description</b> <u>The request sent by the client was syntactically incorre
      ct ().</u></p><HR size="1" noshade="noshade"><h3>JBossWeb/2.0.1.GA</h3></body></