Some OData producers require custom url parameters to be given. A common
example is to supply an "API Key" to authorize the request.
I have implemented this new feature as an OClientBehavior. The attached class
addresses this feature. I hope you will consider it for a future release.
Example usage:
Builder builder = ODataConsumers.newBuilder(endpointUri);
List<OClientBehavior> behaviors = new ArrayList<OClientBehavior>();
/*
* Add a custom URL parameter to specify the Intel API Key
*/
behaviors.add(new CustomParametersBehavior("api_key", IntelApiKey));
if (format != null) {
builder = builder.setFormatType(format);
}
if (methodToTunnel != null) {
behaviors.add(new MethodTunnelingBehavior(methodToTunnel));
}
if (behaviors.size() > 0)
builder = builder.setClientBehaviors(behaviors.toArray(new OClientBehavior[]{}));
Original issue reported on code.google.com by mcoo...@magnicomp.com on 31 Mar 2014 at 8:15
Original issue reported on code.google.com by
mcoo...@magnicomp.com
on 31 Mar 2014 at 8:15Attachments: