AnsweredAssumed Answered

problem access REST API via Grail plugin rest-client-build

Question asked by suseno on May 22, 2013
Latest reply on May 23, 2013 by suseno
I'm facing a problem call activiti REST API..
I'm calling REST API using grails plugin rest-client-build..

my code :

[

   def index() {
      
      def resp = rest.post('http://localhost:8080/activiti-rest/service/login') {
         accept "application/json"
         contentType "application/json"
         json {
            userId='kermit'
            password='kermit'
         }
      }
      println resp.status
      
      
   }
   
   def get() {
      def resp = rest.get('http://localhost:8080/activiti-rest/service/process-instances') {
         accept "application/json"
         contentType "application/json"   
      
      }
      println resp.status
      
      
   }
]

when i called index().. it is success .. REST API  response 200

but when i called get() .. it always returns 403

What should i do to correct that problem


thx


Outcomes