I have a queryparam called key and its value "148BWGD+aUZWag/Y==".
When i tried to fetch value of variable "key" using ExtractVariables policy,
I am getting "148BWGD aUZWag/Y==" in trace.
i.e., + is being replaced with a space.
How can i retrieve original value of varaible key withiout replacing + by space?
Solved! Go to Solution.
That may be correct behavior depending on how your client is sending in the query param.
The + is a reserved character in URLs; RFC3986 states that it must be percent-encoded by the client before sending the request. Otherwise + is treated as an encoding for the space character, in other words decimal 32 in ASCII.
Therefore: if your client is really sending in a query parameter containing "148BWGD+aUZWag/Y==", then the specification says that the server (Apigee in this case) should interpret that as "148BWGD aUZWag/Y==". Which is what you are seeing.
To allow Apigee to get a + character, the client must send the properly encoded form: "148BWGD%2BaUZWag/Y==".
See here for information on Percent-encoding. And see here for information on encoding within query parameters, specifically the + character.
That may be correct behavior depending on how your client is sending in the query param.
The + is a reserved character in URLs; RFC3986 states that it must be percent-encoded by the client before sending the request. Otherwise + is treated as an encoding for the space character, in other words decimal 32 in ASCII.
Therefore: if your client is really sending in a query parameter containing "148BWGD+aUZWag/Y==", then the specification says that the server (Apigee in this case) should interpret that as "148BWGD aUZWag/Y==". Which is what you are seeing.
To allow Apigee to get a + character, the client must send the properly encoded form: "148BWGD%2BaUZWag/Y==".
See here for information on Percent-encoding. And see here for information on encoding within query parameters, specifically the + character.
Thank You for providing more information.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |