Encode binary URI params

When a parameter was specified as a binary it was not encoded and ids in ElasticSearch needs to be uri-encoded.