0
<$http.post('http://localhost:8383/HTML5Application1/',{text:'Hello'},{params:{id:'5'}});>

I m new to angularJS and http request's , when I'm posting this request and checking the same in Chrome dev tool ,err_empty_request error is coming.

Can any one guide what I'm doing wrong ?

7
  • Hi @aditya seems like the response you post is not correct i'm not sure what it is, but it's not a legit request, can you please give more details or ad jsfiddle so i can help you? Commented Jul 13, 2014 at 9:13
  • you have to post your code, front-end and back-end Commented Jul 13, 2014 at 9:36
  • @LiadLivnat link.This is the plunker ,here when i'm using get and in URL giving todos.json it is working .In post method in url giving path for my local host . Is something wrong here ? Kindly help Commented Jul 13, 2014 at 14:51
  • @Aditya thanks, for some reason i can't load the plunker, can you send jsfiddle instead? Commented Jul 13, 2014 at 15:30
  • ok it's working now, but i'm not sure what are you trying to do? Commented Jul 13, 2014 at 15:35

1 Answer 1

1

use the following code instead:

var controller_data = {"text":"hello","id":"5"};
$http({url: 'http://localhost:8383/HTML5Application1/' , method: "POST",withCredentials: true,data:controller_data});
Sign up to request clarification or add additional context in comments.

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.