Instead of creating the url path with the query yourself, please use the query parameter (4th parameter for ->request). Like this it also works in case an other protocol is used.