Using curl to set game category using Channel Update

Using localhost is fine, as long as you have either a server running on localhost to handle the OAuth process, or manually do it from the URL bar of the browser.

You need the broadcaster of the channel you’re wishing to edit go through the OAuth flow Getting OAuth Access Tokens | Twitch Developers to grant you permissions to edit the game that they are playing.

No, a username will not work here. As the documentation specifies, Reference | Twitch Developers, you need to use the channels Twitch ID.