I am using below post method for google account using curl but it gives me invalid_request error.
POST /o/oauth2/token HTTP/1.1 Host: accounts.google.com Con
The response to your request actually includes a very readable description of the problem:
POST requests require a Content-length header.
Content-length