Feature Description
Currently, the Accept-header is hard coded in RemoteUrl:
private static final String ACCEPT_HEADER_VALUE = "application/json, application/yaml, */*";
Users can't change it, even if their Api might require different headers
Use Case
When using the GH file api, one has to set the Accept-header to application/vnd.github.v3.raw to retrieve the raw file content. This is currently not possible.
Suggested Solution (optional)
The easiest solution would be to back-off if the user provided its own header using the already existing List<AuthorizationValue> auths:
private static void setRequestHeaders(List<AuthorizationValue> header, URLConnection conn) {
conn.setRequestProperty("Accept", ACCEPT_HEADER_VALUE);
conn.setRequestProperty("User-Agent", USER_AGENT_HEADER_VALUE);
// allows user to override defaults
for (AuthorizationValue item : header) {
conn.setRequestProperty(item.getKeyName(), item.getValue());
}
}
I'am happy to provide the PR if you agree with this course of action
Alternatives Considered
No workaround exists since the behavior is hard coded
Additional Context
Checklist
Feature Description
Currently, the Accept-header is hard coded in
RemoteUrl:Users can't change it, even if their Api might require different headers
Use Case
When using the GH file api, one has to set the Accept-header to
application/vnd.github.v3.rawto retrieve the raw file content. This is currently not possible.Suggested Solution (optional)
The easiest solution would be to back-off if the user provided its own header using the already existing
List<AuthorizationValue> auths:I'am happy to provide the PR if you agree with this course of action
Alternatives Considered
No workaround exists since the behavior is hard coded
Additional Context
Checklist