Skip to content

RestTemplate - access to Request Headers [SPR-5866] #10535

Closed
@spring-projects-issues

Description

@spring-projects-issues

Graham Zabel opened SPR-5866 and commented

Hi,

When sending GET and POST requests, we are required to send a Security token in the HTTP header. Currently with RestTemplate there is no easy way to set headers on the request.

The only way that seems possible is to provide a custom RequestCallback, in which the httpRequest object can be manipulated in doWithRequest(), making all but the execute() method unusable.

Is there a clean and easy way to set http headers on requests? (I can't think of one without some significant rewrites).

thanks,
Graham


Issue Links:

2 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions