Error occurring in Post API of person

Following is the code i am using for hitting via try it and execute section of openmrs. i am also screen shot of response from server.

Note:if same thing is done for GET it works fine ,but with POST shows this message.

{

“names”: [

{

  "givenName": "pushkar",

  "middleName": "singh",

  "familyName": "negi",

  "familyName2": "string",

  "preferred": true,

  "prefix": "string",

  "familyNamePrefix": "negi",

  "familyNameSuffix": "negi",

  "degree": "string"

}

],

“gender”: “M”,

“age”: 32,

“birthdate”: “1984-11-11”,

“birthdateEstimated”: true,

“dead”: true,

“deathDate”: “string”,

“causeOfDeath”: “string”,

“addresses”: [

{

  "preferred": true,

  "address1": "nilmatha",

  "address2": "string",

  "cityVillage": "string",

  "stateProvince": "string",

  "country": "string",

  "postalCode": "string",

  "countyDistrict": "string",

  "address3": "string",

  "address4": "string",

  "address5": "string",

  "address6": "string",

  "startDate": "string",

  "endDate": "string",

  "latitude": "string",

  "longitude": "string"

}

],

“attributes”: [

{

  "attributeType": "uuid",

  "value": "string",

  "hydratedObject": "uuid"

}

],

“deathdateEstimated”: true,

“birthtime”: “2019-01-24T10:34:20.770Z”

}

@govind , it would be much more clear and helpful if you pasted the response content to pastebin.com and dropped the link here.

I didn’t received any response in server console.Please help me out,what should i do.

Iclick on this link https://pastebin.com/ 2.

copy the error output and paste in pastebin where the cursor is blinking from. - Click on create new paste - Enter the code given if any - click submit. - Copy the link after submit and share here. Hope it works for you. Govind kindly use this, so that Nathan can best review where the problem could be. thanks

I am using rest web services of openMRS

On GET API : works fine

On POST API: 404 : “Bad request comes” and shows Response: “user not logged In”.

This is my openMRS log https://pastebin.com/sd03nnWX

Please suggest me quick solution.

@govind , sorry for the inconvenience you are having. However not all GET info can be POSTed. You may want to follow the convention explained in wiki. Below is the link to there https://wiki.openmrs.org/display/docs/REST+Web+Services+API+For+Clients

My Simple problem is : i want to create new patient using opernMRS rest POST API and when i m trying then getting following error .

This is my openMRS log https://pastebin.com/sd03nnWX

Please suggest me quick solution.

@govind , with the result you are getting, if that is with the POST, following the convention I referred to earlier, then your request is successful. :slightly_smiling_face:

Here though, you are not quite clear what error/problem you are facing. You may want to clearly explain whats not going on right.