1

I am having a huge amount of trouble with this one simple POST request. Here is my code:

monGoose := WebClient(`https://accounts.google.com/o/oauth2/token/`)
monGoose.postForm(["code":mongoosetoken_string, "redirect_uri":redirect_string, "client_id":client_id_string, "client_secret":client_secret_string, "scope":"", "grant_type":"authorization_code"])
echo(monGoose.resStr)

It just sets up a web request to https://accounts.google.com/o/oauth2/token/ and then posts the other data per OAuth 2.0 specifications. However, this keeps returning nothing useful, just a 404 code. Any tips or pointers? Anything incredibly obvious that i'm doing wrong? Sorry if it's too vague, i'm just very lost.

clive alton
  • 131
  • 1
  • 8
  • Are you sure the URL is not [https://accounts.google.com/o/oauth2/auth](https://accounts.google.com/o/oauth2/auth) as mentioned in Google's [Using OAuth 2.0](https://developers.google.com/accounts/docs/OAuth2WebServer)?? – Steve Eynon Dec 03 '14 at 01:04

1 Answers1

0

I fixed it! It needed to be

https://accounts.google.com/o/oauth2/token 

not

https://accounts.google.com/o/oauth2/token/
clive alton
  • 131
  • 1
  • 8
  • 1
    If this solved you problem it is a good idea to mark your own answer as accepted! In that way others can easily see that it is solved. – Lii Jun 11 '15 at 11:00
  • 1
    I also see in your profile that you have several questions with no accepted answer. It would be a good idea to have a look at those too. For one thing, it could discourage people from answering your questions if they see that answers are rarely accepted. If you found the answer yourself it is a good idea to make an answer out of it as you did here. – Lii Jun 11 '15 at 11:04
  • Thank you for your advice! I will get on that. – clive alton Jun 11 '15 at 22:50