Fix for issue #736: ngResource now accepts headers #965

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
8 participants
@maxmart
Contributor

maxmart commented May 17, 2012

With this fix it is possible to specify HTTP headers in the actions parameter of ngResource.
For example, to be able to send conditional PUT requests you could specify:

$resource('/CreditCard/123', {}, {
  add: {
    method: 'PUT',
    headers: {'If-None-Match': '*'}
  }
});

As I understand it, this should resolve issue #736

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Jun 5, 2012

please, revert this, to keep new line at the end of the file

please, revert this, to keep new line at the end of the file

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Jun 5, 2012

same as above

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Jun 5, 2012

keep two empty lines in between specs...

keep two empty lines in between specs...

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Jun 5, 2012

space after key: 123

space after key: 123

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Jun 5, 2012

LGTM only little bit of formatting...

Could you please change commit message according to our convention https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit to

feat($resource): allow defining headers per action

Closes #736

Thank you very much. We really appreciate that.

LGTM only little bit of formatting...

Could you please change commit message according to our convention https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit to

feat($resource): allow defining headers per action

Closes #736

Thank you very much. We really appreciate that.

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Jun 5, 2012

Contributor

Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement).

CLA is important for us to be able to avoid legal troubles down the road.

For individuals (a simple click-through form):
http://code.google.com/legal/individual-cla-v1.0.html

For corporations (print, sign and scan+email, fax or mail):
http://code.google.com/legal/corporate-cla-v1.0.html

Contributor

vojtajina commented Jun 5, 2012

Thanks for your contribution! In order for us to be able to accept it, we ask you to sign our CLA (contributor's license agreement).

CLA is important for us to be able to avoid legal troubles down the road.

For individuals (a simple click-through form):
http://code.google.com/legal/individual-cla-v1.0.html

For corporations (print, sign and scan+email, fax or mail):
http://code.google.com/legal/corporate-cla-v1.0.html

@vojtajina

This comment has been minimized.

Show comment
Hide comment
@vojtajina

vojtajina Jun 5, 2012

Contributor

Oops, I'm sorry Max, I can see you already did sign the CLA, so please ignore my previous msg...

Contributor

vojtajina commented Jun 5, 2012

Oops, I'm sorry Max, I can see you already did sign the CLA, so please ignore my previous msg...

@maxmart

This comment has been minimized.

Show comment
Hide comment
@maxmart

maxmart Jun 5, 2012

Owner

Like this? :-)

Owner

maxmart commented on 5bec221 Jun 5, 2012

Like this? :-)

@stefan79

This comment has been minimized.

Show comment
Hide comment
@stefan79

stefan79 Jun 5, 2012

Cool. Starting using angular today, found the problem with base authenticated rest resources this afternoon and found the patch this evening. Impressed.....

stefan79 commented Jun 5, 2012

Cool. Starting using angular today, found the problem with base authenticated rest resources this afternoon and found the patch this evening. Impressed.....

@maxmart

This comment has been minimized.

Show comment
Hide comment
@maxmart

maxmart Jul 2, 2012

Contributor

ping... ? :)

Contributor

maxmart commented Jul 2, 2012

ping... ? :)

@stefan79

This comment has been minimized.

Show comment
Hide comment
@stefan79

stefan79 Jul 2, 2012

Me?

Sent from my iPhone

On 02.07.2012, at 18:10, Max Martinssonreply@reply.github.com wrote:

ping... ? :)


Reply to this email directly or view it on GitHub:
#965 (comment)

stefan79 commented Jul 2, 2012

Me?

Sent from my iPhone

On 02.07.2012, at 18:10, Max Martinssonreply@reply.github.com wrote:

ping... ? :)


Reply to this email directly or view it on GitHub:
#965 (comment)

@jarretraim

This comment has been minimized.

Show comment
Hide comment
@jarretraim

jarretraim Jul 3, 2012

Any chance I can get an update on this one? I'm trying to integrate with a Rackspace ReST API and they auth using a custom X-Auth-Header. Is there a workaround without this patch? Or should I just patch my local copy?

Any chance I can get an update on this one? I'm trying to integrate with a Rackspace ReST API and they auth using a custom X-Auth-Header. Is there a workaround without this patch? Or should I just patch my local copy?

@NathanWalker

This comment has been minimized.

Show comment
Hide comment
@NathanWalker

NathanWalker Jul 24, 2012

I am also curious of the status on this pull request. Similar to above, trying to integrate with a RESTapi that uses Basic Authentication. Would really like to be able to set the 'Authorization' header with a $resource.

I am also curious of the status on this pull request. Similar to above, trying to integrate with a RESTapi that uses Basic Authentication. Would really like to be able to set the 'Authorization' header with a $resource.

@zergin

This comment has been minimized.

Show comment
Hide comment
@zergin

zergin Aug 15, 2012

I'd also like to know the status of this issue. It's critical to be able to set authorization header (among others).

zergin commented Aug 15, 2012

I'd also like to know the status of this issue. It's critical to be able to set authorization header (among others).

@mhevery

This comment has been minimized.

Show comment
Hide comment
@mhevery

mhevery Sep 4, 2012

Member

sorry about the delay, working on merging it now

Member

mhevery commented Sep 4, 2012

sorry about the delay, working on merging it now

@mhevery

This comment has been minimized.

Show comment
Hide comment
@mhevery

mhevery Sep 4, 2012

Member

MERGED

Member

mhevery commented Sep 4, 2012

MERGED

@mhevery mhevery closed this Sep 4, 2012

@nateabele

This comment has been minimized.

Show comment
Hide comment
@nateabele

nateabele Sep 4, 2012

Woohoo! Thanks @mhevery!

Woohoo! Thanks @mhevery!

@jarretraim

This comment has been minimized.

Show comment
Hide comment
@jarretraim

jarretraim Sep 4, 2012

Thanks, this is great.

Thanks, this is great.

@mgonto mgonto referenced this pull request in mgonto/restangular May 2, 2013

Closed

Headers not send #40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment