-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add headers and path dynamically based on request body #1022
Comments
It would probably be a bit tricky but there are some pieces in the code that will help you get started. Reading the body in a way that allows code downstream to read the body as well is the trickiest part. There is code in Once you have the body though you can convert the XML to JSON and also modify the with the correct path and headers. You can do something similar in a post filter for when returning the response. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Sorry I didn’t updated git issue, after doing lot of research I found
solution. Now my code will work for any type of request and responses.
Thanks for very good spring cloud gateway api frame work provided by
spring. Hope spring will externalize modifyrequestbody and modifyresponse
body to configure in yml files so that I can change config properties with
out touching code.
Regards,
Siva
…On Wed, May 8, 2019 at 7:49 AM Spring Issuemaster ***@***.***> wrote:
If you would like us to look at this issue, please provide the requested
information. If the information is not provided within the next 7 days this
issue will be closed.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1022 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH2TTNPBZPAFT5FSD2RMLN3PULD37ANCNFSM4HHNVEAQ>
.
|
Please don’t close this issue I will update code here, if any draw backs or if it not productive or scalable, I can get inputs after seeing code so that I can refactor my code and if any have same requirement to modify request and response and based on request and if they need to set path dynamically can use this code. |
|
@ryanjbaxter, Please review my code and let me know if any drawbacks and suggestions. |
I have a requirement where we need to develop Spring API gate way to consume soap request (xml in the form of string) convert request body to JSON and hit Rest services which consume Json object and response Json object need to convert to XML in the form of sting and send it back to consumer. Up to here we are good but my question how to add or modify headers and path based on request body. Is there any way in modify request method to add headers and path dynamically?
The text was updated successfully, but these errors were encountered: