Why I’m getting CS1012: “Too many characters in character literal” and CS0019?

You’re trying to use single quotes for string literals – that’s invalid in C#. Single quotes are for character literals (char). You need double quotes for string literals. You also need parentheses for a method call:

webRequest.Headers["Authorization"] = "Bearer " + GetToken();

(Note that this has nothing to do with imgur or WebRequest – it’s just normal C#.)

Links to MSDN explanations with samples:

Leave a Comment