You need to sign in to do that
Don't have an account?
David Roberts 4
How can I post to a web site and launch it at the same time?
I can Http post to a website from Apex
and I can navigate to a page reference from Aura.
How can I combine the two so that I open a web site while passing (not in the url) some parameters?
Is the only way to do the two steps?
To combine HTTP POST with passing parameters and navigating to a website from Aura, you can use a combination of Apex and JavaScript in your Aura component's controller. Here's an example of how you can achieve this:
Create an Apex method that performs the HTTP POST request and returns the response. This can be done using the HttpRequest and HttpResponse classes in Apex. Here's an example of an Apex method that performs an HTTP POST: In your Aura component's JavaScript controller, call the Apex method to perform the HTTP POST request and handle the response. You can use the window.open() function to open the website in a new tab or window. Here's an example:
If this helps , please mark this as Best Answer.
Thank you.
Hello Subrat,
Thanks for your prompt response.
I'm doing something very similar although using navigation to call the web page. I didn't want to pass the parameters in the URL so that they remain secret (not exposed in the url). I decided that the web site will have to store the sent data along with a unique identifier. Then, the identifier is added to the url and, when the page is opened, the data is retrieved.
We're just testing this now...
I was hoping for somthing like:
var pageReference = {
type: 'standard__webPage',
attributes: {
"url": pageUrl
}
parameters: {
"p1" : "value1",
"p2" : "value2"
}
};//pageReference
but will have to make do with two steps.