public static String generateUrl(String baseUrl, UrlParameters... params) { return generateUrl(baseUrl, Arrays.asList(params)); }
public static String generateUrl(String baseUrl, UrlParameters... params) { return generateUrl(baseUrl, Arrays.asList(params)); }
public RawResponse makePutRequest(String endpoint, String content, UrlParameters... urlParams) { String url = prepareUrl(agentAddress + endpoint); url = Utils.generateUrl(url, urlParams); return httpTransport.makePutRequest(url, content); }
public RawResponse makeDeleteRequest(String endpoint, UrlParameters... urlParams) { String url = prepareUrl(agentAddress + endpoint); url = Utils.generateUrl(url, urlParams); return httpTransport.makeDeleteRequest(url); }
public RawResponse makePutRequest(String endpoint, byte[] content, UrlParameters... urlParams) { String url = prepareUrl(agentAddress + endpoint); url = Utils.generateUrl(url, urlParams); return httpTransport.makePutRequest(url, content); }
public RawResponse makePutRequest(String endpoint, byte[] content, UrlParameters... urlParams) { String url = prepareUrl(agentAddress + endpoint); url = Utils.generateUrl(url, urlParams); return httpTransport.makePutRequest(url, content); }
public RawResponse makeGetRequest(String endpoint, List<UrlParameters> urlParams) { String url = prepareUrl(agentAddress + endpoint); url = Utils.generateUrl(url, urlParams); return httpTransport.makeGetRequest(url); }
public RawResponse makePutRequest(String endpoint, String content, UrlParameters... urlParams) { String url = prepareUrl(agentAddress + endpoint); url = Utils.generateUrl(url, urlParams); return httpTransport.makePutRequest(url, content); }
public RawResponse makeGetRequest(String endpoint, List<UrlParameters> urlParams) { String url = prepareUrl(agentAddress + endpoint); url = Utils.generateUrl(url, urlParams); return httpTransport.makeGetRequest(url); }
public RawResponse makeDeleteRequest(String endpoint, UrlParameters... urlParams) { String url = prepareUrl(agentAddress + endpoint); url = Utils.generateUrl(url, urlParams); return httpTransport.makeDeleteRequest(url); }
@Test public void testGenerateUrl_Simple() throws Exception { assertEquals("/some-url", Utils.generateUrl("/some-url")); assertEquals("/some-url", Utils.generateUrl("/some-url", (UrlParameters) null)); assertEquals("/some-url", Utils.generateUrl("/some-url", null, null)); }
@Test public void testGenerateUrl_Parametrized() throws Exception { UrlParameters first = new SingleUrlParameters("key", "value"); UrlParameters second = new SingleUrlParameters("key2"); assertEquals("/some-url?key=value&key2", Utils.generateUrl("/some-url", first, second)); }
@Test public void testGenerateUrl_Encoded() throws Exception { UrlParameters first = new SingleUrlParameters("key", "value value"); UrlParameters second = new SingleUrlParameters("key2"); UrlParameters third = new SingleUrlParameters("key3", "value!value"); assertEquals("/some-url?key=value+value&key2&key3=value%21value", Utils.generateUrl("/some-url", first, second, third)); }