Java Code Examples for com.ning.http.client.RequestBuilder#setRealm()
The following examples show how to use
com.ning.http.client.RequestBuilder#setRealm() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Zendesk.java From scava with Eclipse Public License 2.0 | 5 votes |
private Request req(String method, Uri template) { RequestBuilder builder = new RequestBuilder(method); if (realm != null) { builder.setRealm(realm); } else { builder.addHeader("Authorization", "Bearer " + oauthToken); } builder.setUrl(template.toString()); return builder.build(); }
Example 2
Source File: Zendesk.java From scava with Eclipse Public License 2.0 | 5 votes |
private Request req(String method, Uri template, String contentType, byte[] body) { RequestBuilder builder = new RequestBuilder(method); if (realm != null) { builder.setRealm(realm); } else { builder.addHeader("Authorization", "Bearer " + oauthToken); } builder.setUrl(template.toString()); builder.addHeader("Content-type", contentType); builder.setBody(body); return builder.build(); }
Example 3
Source File: Zendesk.java From scava with Eclipse Public License 2.0 | 5 votes |
private Request req(String method, Uri template, int page) { RequestBuilder builder = new RequestBuilder(method); if (realm != null) { builder.setRealm(realm); } else { builder.addHeader("Authorization", "Bearer " + oauthToken); } builder.addQueryParameter("page", Integer.toString(page)); builder.setUrl(template.toString().replace("%2B", "+")); //replace out %2B with + due to API restriction return builder.build(); }