Skip to content

url param containing ? is not getting encoded by Rest Template [SPR-14101] #18673

Closed

Description

@spring-projects-issues

Taranjit Singh opened SPR-14101 and commented

Hi I have a get request url which I am trying to send via RestTemplate, like :

url?param1=a1&param2=a2 and so no

one of the params in turn comprises a "?" (question mark)

So, I get 403 forbidden response as Spring's Rest Template does not encode it by substituting with %3F while all other values in the same param like space(%20) and equals to(%3D) are getting substituted.

It should encode ? present in the param value as well.
If it cannot, what is the other way to resolve that.

If you could help as this is a bit urgent.

Thanks,
Taran


Issue Links:

Activity

  1. spring-projects-issues commented on Apr 1, 2016

    @spring-projects-issues
    CollaboratorAuthor

    Rossen Stoyanchev commented

    "?" is a legal character in the query string as per RFC 3986 so we are not doing anything wrong.

    Note however that the RestTemplate provides a hook for customizing URI template handling (the uriTemplateHandler property). The DefaultUriTemplateHandler provides some built-in options and for 4.3 it will also include a strictEncoding property that encodes every reserved character in a URI variable.

  2. added
    status: declined
    type: enhancement
    in: web
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webstatus: declinedtype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions