Post Service give error of 500 Internal Server error

I write code in my application and it give me error 500 Internal Server Error.

$http.post(‘api/apiname’, mydata,
{headers: {‘Content-Type’: ‘application/json’,‘Accept’: ‘application/json’}}
).success(function (data)
{
console.log(data);
});

Please help me with this error.

HI, we are not able to help you without logs and code.

This is server side error, you should find out the error detail in your log to fix it from your server.