This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 252258 - Request Header for @OnReceive
Summary: Request Header for @OnReceive
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Html4j (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2015-05-06 07:00 UTC by maxnitribitt
Modified: 2015-05-28 07:20 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
A patch introducing @OnReceive.headers() (98.71 KB, patch)
2015-05-21 19:24 UTC, Jaroslav Tulach
Details | Diff
The final diff with javadoc comments (131.97 KB, patch)
2015-05-27 21:31 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description maxnitribitt 2015-05-06 07:00:46 UTC
A lot of REST services require setting the Authorization Header on a request instead of having credentials in the URL.  

E.g. to use the Twitter Bearer Token  for application only requests, which is the simplest form ( https://dev.twitter.com/oauth/application-only ) one needs to set the Authorization header for the request. Right now this is not possible with @onreceive. 

There should be a way to add request headers in order to comply with this widespread practice.
Comment 1 Jaroslav Tulach 2015-05-21 19:24:56 UTC
Created attachment 153797 [details]
A patch introducing @OnReceive.headers()

I think Max's problem could be solved by adding on more attribute to the @OnReceive annotation. The API is simple. The actual SPI may not be optimal, but please Max, give the patch try and let us know if it works for you.
Comment 2 Jaroslav Tulach 2015-05-21 19:26:23 UTC
Alternative providers of various @OnReceive SPI, please verify you are OK with the change. We have about a week to consider the impact of this change and polish the patch to include appropriate API change attributes.
Comment 3 Jaroslav Tulach 2015-05-27 21:02:10 UTC
No objections so far. I'd like to integrate tomorrow.
Comment 4 Jaroslav Tulach 2015-05-27 21:31:13 UTC
Created attachment 153911 [details]
The final diff with javadoc comments
Comment 5 Jaroslav Tulach 2015-05-28 07:20:46 UTC
http://hg.netbeans.org/html4j/rev/bdec4103bdb2