Hello ppadmanaban.1,
It looks like you're trying to encode the incoming request, it won't work.
The encoding needs to be done on client side. You use the encode assertion only if the gateway is the client and the gateway compose a request and send it to backend.
Furthermore, you should not encode the whole url, only need to encode the parameter value.
Regards,
Mark