Fix issues with request-with-encoding.js

Remove unnecessary semicolon, add braces preemptively in places where they're omitted because optional and use triple equals signs for checking for equality.