I'm pretty sure {url: url, method: 'PUT', {data: {foo: 'baz bar'}}} is
ill-formed JSON and the $http object will just ditch it.

I could put {url: url, method: 'PUT', data: {data: {foo: 'baz bar'}}} in
and get the wrapped data stuff, but I was expecting just {foo: 'baz bar'}
on the server side, as 90% of my $http calls were bare $http(options) calls.

There were a few interface actions (most of which were corner cases) which
ended up using the convenience methods, and in those situations the extra
layer of data: in the json object was annoying my backend.

e



On Fri, Aug 22, 2014 at 2:45 PM, 'Michael Bielski' via AngularJS <
[email protected]> wrote:

> {data: {foo: 'baz bar'}}
>>
>
> is not the same as
>
>
>> data: {foo: 'baz bar'}
>>
>
> The difference is that you have the first one wrapped in an extra set of
> {}s, which tells $http that that is what you want to send for the data. If
> you did $http({url: url, method: 'PUT', {data: {foo: 'baz bar'}}}) you'd
> probably have the same thing come across.
>
>>  --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to