简体   繁体   中英

Rest Get: How to add “URL with Query Parameters” in Query Parameters of a URL?

I have got requirements like below:

在此处输入图像描述

 /paymenturl?ordernr=123&amount=234&ourOwnCallbackUrl=$api/receipt?contractid=3232&callbackurl=https://somthing.com&fallbackurl=https:something.com&notification=hit-hard
  1. Is it possible to add url in query parameter? (callbackUrl)
  2. Is it possible to add Step 1 into value of Query Parameter? (ourOwnCallbackUrl)
  3. Is it possible to add Step1 in Step 2 to main url? (/paymenturl)

The question is basically how to add another URL to query parameter and can it be nested further?

you have to escape the special characters (like & ) I see two common ways:

  • encode it in percent-encoded

    %20%2Fpaymenturl%3Fordernr%3D123%26amount%3D234%26ourOwnCallbackUrl%3D%24api%2Freceipt%3Fcontractid%3D3232%26callbackurl%3Dhttps%3A%2F%2Fsomthing.com%26fallbackurl%3Dhttps%3Asomething.com%26notification%3Dhit-hard

  • or you can create a complete DTO (Data transfer object ) and use the request body to send/receive it from your controller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM