Mulesoft dynamic http routing based on the input - mulesoft

I am new to mulesoft 4.4, I can to send http request to url xyz with one http_request_configuration, but I need to select application url dynamically based on the users input payload (kind of http routing with different host), I don't know how to achieve this in mulesoft. Do I need to crate multiple http_request_configuration for this?
Kind regards
J Babu

You can set the URL at the HTTP Request operation level. For example using a variable:
<http:request method="GET" doc:name="Request" url="#[vars.myUrl]"/>
Note that you should not try to use the URL to add query parameters. Use the HTTP Request query params feature for that.

Related

Is there any way to customize the URL of a HTTP request trigger?

My logic app HTTP url is something like this:
https://prod-98.eastus.logic.azure.com/workflows/8767e7ecd19c45adbfb01d681e35a888/triggers/manual/paths/invoke/ABCDEFG/api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=U-M0hnvs9BICC_JV7_nTJRQhWg5oZnD_SVo9Sbm03oo
It is not presentable.
I like to make the URL of HTTP request trigger more polished and presentable.
Is there any way to customize the URL of a HTTP request trigger?
Using a clean custom DNS and URL path ( like https://MyDnsName.com/Path/Action ) is the prefrable solution, but anything better than what currenty provided would do.
As far as I know, When a HTTP request is received trigger will automatically generate the URL, and it cannot be changed manually.
This URL includes query parameters that specify a Shared Access Signature (SAS) key, which is used for authentication.
I haven't thought of a way to completely customize the URL to https://MyDnsName.com/Path/Action, but there are two ways to make it look more meaningful.
1. Function App Proxy
After you create an Azure Function App, you can create an proxy.
After you create Azure Function App proxy, your URL is in this format:
https://<function-name>.azurewebsites.net/xxx
2. API management
After creating an Azure API Management service instance, you can customize the URL suffix.
After you create a API management, your URL is in this form:
https://<API management-name>.azure-api.net/xxx

How can I get the Current URL Protocol in DNN?

How can I get Https or Http in the backend code of a DNN module?
Currently, I have got this code, but I need the protocol (https:// or http://)
PortalSettings.Current.PortalAlias.HTTPAlias + PortalSettings.HomeDirectory + PortalSettings.LogoFile;
You can maybe use this to check if the current tab has https enabled (to check the request itself you can use Request.IsSecureConnection)
PortalSettings.ActiveTab.IsSecure
And/or
PortalSettings.SSLEnabled;
PortalSettings.SSLEnforced;
PortalSettings.SSLURL;
If you want it for the current URL, you can use the regular .NET API's as well.
HttpContext.Current.Request.Url.Scheme
That will return http or https based on the current request URL. Its the fastest way that I'm aware of to do this.

What is the main reason to use headers for authentication tokens?

Just getting up to speed with authentication in angular . What I read a lot is the usage of headers to pass in a token like here: $http Auth Headers in AngularJS
My question is with passing in the token for every request to the backend what are the main reasons to use headers? Is this just for a cleaner solution or is it for performance?
Using headers for this isn't an Angular thing, many APIs use these so that for example a server can determine if the client should be allowed access quickly by examining only the headers and not the request body. This allows better separation of concerns between authentication and authorization functions, and payload processing on the server.
Upstream servers (of which there may be many layers) can add and remove headers and generally route and authorize your request more efficiently than if this data were to be in the request body.
Headers also keep authentication data out of URL request parameters which looks cleaner but also stops authentication data appearing in browser history etc.
One downside could be that if you are making requests through a network proxy there's a chance that the proxy may strip some headers especially if they're non-standard names.
If your connection to server is HTTPS then HTTP HEADERS are also encrypted. Where as query params are not.

CXF. Is it possible to log the request/response XML without using Interceptor?

I would like to get the request XML in my Web service method and would like to save it. I know I can use LoggingInInterceptor to do that. However, I do not want to use it. The reason is when I save the request XML, I would like to perform user validations, get the client name and use the client name as the File name to save it.
Is there a way I can get the request XML in my Web service method.
No, you cannot. But you can write a generic HTTP service which gets the text content of a request.

Apache sticky session from response header

I have a requirement where I need to route a series of requests to the same member
in a load balancer cluster.
The requests look like this:
/server/create-some-id => responds with a unique ID
/server/do-something-with-id/{ID}
/server/do-something-with-id/{ID}
... etc.
The requirement is that requests 2 and on have to be routed to the same balancer
member as request 1. Due to some legacy code, I can't just create a cookie in
the response of request 1 to use for routing.
I'm wondering if there's an Apache module which is able to SetEnvIf based on either
a response header or the response body, or any other way to solve this?
Thanks!
It does not seem to be possible to enable stickyness based on the response headers or body in Apache 2.

Resources