Hello code400 friends,
I am working on a program to consume a web service by passing query params.
To handle special characters in the URL, i.e. & (amp), space, etc, I am doing the scan and replace each special character and encode. Ex: Replace "&" with %26, space with %20, " with %22 etc.
Is this the correct approach or is there a better way to handle all special characters rather than checking for each special character in a string?
Ex: To search for customer Customer "A & R Resources, the URL should be /customer/get?CustomerName=A%26R%20Resources
Thank you.
I am working on a program to consume a web service by passing query params.
To handle special characters in the URL, i.e. & (amp), space, etc, I am doing the scan and replace each special character and encode. Ex: Replace "&" with %26, space with %20, " with %22 etc.
Is this the correct approach or is there a better way to handle all special characters rather than checking for each special character in a string?
Ex: To search for customer Customer "A & R Resources, the URL should be /customer/get?CustomerName=A%26R%20Resources
Thank you.
Comment