Stripe Authentication


I am not able to authenticate in - using Basic Authentication

public class Str extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        PrintWriter pw=response.getWriter();
        pw.println("Hello World");
        HttpClient client= new HttpClient();
        String req="";
        client.getState().setCredentials(new AuthScope(req, 443, null),  new UsernamePasswordCredentials("<api-key>"));
        client.getHostConfiguration().setHost(req, 443, "https");

        PostMethod post= new PostMethod("");
        //post.addParameter("id", "<id>");
        int status=client.executeMethod(post);



i am presenting my code...where i hv used HTTP Basic Auth to provide the users credentials to


Try: new UsernamePasswordCredentials("

By : brian

Hope this will help you.

Here API_KEY means secrete key

HttpResponse httpResponse;
String request ='card[number]=' card_name '
By : Naveen

This video can help you solving your question :)
By: admin