AnsweredAssumed Answered

error while creating user by restApi

Question asked by priyankasoni on Jul 22, 2013
Latest reply on Jul 23, 2013 by priyankasoni
hi i ma getting error

DefaultHttpClient httpClient = new DefaultHttpClient();
         HttpPost postRequest = new HttpPost(
            "http://localhost:8080/alfresco/service/api/people");
   
         StringEntity input = new StringEntity("{userName : 'testuser' , password: 'testpassword' , firstName : 'testfirst', lastName : 'testlast', email : 'testemail@test.com',  disableAccount: false, quote: -1, groups: []}");
         input.setContentType("application/json");
         postRequest.setEntity(input);
   
         HttpResponse response = httpClient.execute(postRequest);
   
         if (response.getStatusLine().getStatusCode() != 201) {
            throw new RuntimeException("Failed : HTTP error code : "
               + response.getStatusLine().getStatusCode());
         }
   


plz tell where is problem?

Outcomes