encode then parse uri before request