I\'ve asked a question here and I\'ve fixed my problem thanks to an user. This is the code I am using at the moment.
void UploadToDatabase() throws MalformedURLE
For me it was due to incorrect way of using header, like
HttpEntity entity = new HttpEntity("parameters", headers); //Issue was here
I just made as
HttpEntity entity = new HttpEntity(headers); //Fixed Issue
check here other details