Forum Discussion

akshays's avatar
2 years ago

Passing multiple parameters to the endpoint from Component

Hi,

I am trying to send multiple variables to an endpoint. Using an AJAX call to call the endpoint:

            $.ajax({
            type: "GET",
            url: endpointUrl+'?Param1='+param1+'&?Param2'+param2,
            async: false,
            success: function(data){
			console.log(data);
			},

        });
		

 

And also,

            $.ajax({
            type: "GET",
            url: fetchLastCaseUrl,
            async: false,
			data: JSON.stringify(prodData),
            success: function(data){
			console.log(data);
			},

        });
		

 

Where prodData is a JS object.

But neither of these are working. 

I am getting the parameters in the endoint using:

<#assign param1 = http.request.parameters.name.get("Param1","")/>
<#assign param2 = http.request.parameters.name.get("Param2","")/>


With this I am only able to get the first Parameter right. Not the second one.
Any help would be appreciated.

  • I your first example you have 

    &?Param2

    which should just be "&Param2"