0

if using

  $http.delete('api/contacts', Id);  

Then getting error

But When Using

   $http.delete('api/contacts/'+ Id);   

Executing .

I don't Want to use URL Binding To pass data....

Please Help Me To Solve

1
  • Well.. http is desigigned delete by url. First read this. Commented Jan 7, 2015 at 9:17

2 Answers 2

1

According to Restiful API, the delete spec requires you to pass the id.

If you don't want to pass it through the url, then use POST but then your app will not be following restful api styles.

Sign up to request clarification or add additional context in comments.

Comments

0

$http.delete('api/contacts', {data: {id: 666}});

Try that, and have a read about the config object in angular $http.

https://docs.angularjs.org/api/ng/service/$http#usage

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.