How to send Https Post request in java How to send Https Post request in java java java

How to send Https Post request in java


Wrong :- (Extra space is there in mid of www- form)

con.setRequestProperty("Content-Type","application/x-www- form-urlencoded"); 

Correct

 con.setRequestProperty("Content-Type","application/x-www-form-urlencoded"); 


You could be getting a 400 for a few reasons, but usually becaue the data isn't formatted correctly (maybe it takes XML?). Perhaps a record already existed. Try it using postman to see what result you get.