jersey 2.0 - How Can i pass the Basic Credentials while using REST API client Program -


client client = client.create();

        client.addfilter(new httpbasicauthfilter("username", "password"));         webresource resource = client.resource("https://server.location.path");         //webresource.builder builder=resource.getrequestbuilder().header("authorization", "basic base64value");         clientresponse response = resource.accept("application/json")                 .get(clientresponse.class);         system.out.println(response);         string output = response.getentity(string.class);         system.out.println("output server .... \n");         system.out.println(output); 

here have been placed code , please let me know have suggestion please


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -