Forum Discussion

Pabe1975's avatar
Pabe1975
Occasional Contributor
5 years ago

Replacing + character with %2B when sending

When sending a http request with a + in the a field (in this case a field that contains an international phone number with + XX XXXX) the + is replaced with a space.   However in the receiving endp...
  • nmrao's avatar
    nmrao
    5 years ago
    You may use Events feature beforeSubmit method and conditionally replace the value.
  • richie's avatar
    richie
    5 years ago
    Hi Pabe1975,

    Rao's correct (as always), but your + character is being encoded (percent/html encoding) to %2B.

    This is standard html encoding that occurs in all HTTP requests (Rest and Soap), so if an endpoint is struggling with the encoding, especially as you state that the %2B is being replaced by a space character instead, i'd suggest this is a defect and your developers need to be aware of this. Mention percent/html encoding and theyll know what youre talking about.
    If you want to disable the percent encoding there is a checkbox entitled 'Disable encoding' which is available in the 'Advanced options' available at 'Request' level in the Projects section of ReadyAPI!.
    Just an alternative option to Raos.

    Nice one

    Rich