urlencode message only if API version is v1

In API v2, we send data as JSON, so I think we don't have to urlencode message.
This PR skip urlencoding if API version is not v1.