This answer helped me but actually did not work. I still received the error response.
I changed the Post to a Get in this line:
var request = new HttpRequestMessage(HttpMethod.Post...
To:
var request = new HttpRequestMessage(HttpMethod.Get...
Then, it worked fine.