Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does AngularJS 2 HTTP Post only accepts string data?

I am wondering why in AngularJS 2 (2.0.0-beta.13) the HTTP Post method only accepts string data as body and not a JavaScript object as is the case in AngularJS 1.

AngularJS-1:

$http.post(someUrl,someObject)

AngularJS-2:

http.post(someUrl, JSON.stringify(someObject))

Thanks

like image 815
mvermand Avatar asked Jun 16 '26 21:06

mvermand


1 Answers

Because support for other types is not yet implemented https://github.com/angular/http/issues/75

like image 140
Günter Zöchbauer Avatar answered Jun 19 '26 11:06

Günter Zöchbauer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!