hi,
i am trying to create an index through url without using crul command and 
API,but it giving bad request,
this is code snippet which i am using 


    public void sendPost() throws Exception {
         
        String url = "http://localhost:9200/product/apparel/300";;
        URL obj = new URL(url);
        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
 
        //add reuqest header 
        con.setRequestMethod("POST");
        //con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
 
        //String urlParameters = "type=slide";
 
        // Send post request
        con.setDoOutput(true);
        
        int responseCode = con.getResponseCode();
        System.out.println("\nSending 'POST' request to URL : " + url);
        //System.out.println("Post parameters : " + urlParameters);
        System.out.println("Response Code : " + responseCode);
 
        BufferedReader in = new BufferedReader(
                new InputStreamReader(con.getInputStream()));
        String inputLine;
        StringBuffer response = new StringBuffer();
 
        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();
 
        //print result
        System.out.println(response.toString());
 
    }


could you suggest me what  i am doing wrong in this code..


-- 
vahith

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/5ea36f46-606d-402d-b14e-d74a6285b4e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to