I am modifying an existing Web App Builder template and in order to complete the functionality of a widget I need it to make a connection to a backend service. When I pull up the service url, a form comes up that needs to be filled. I have the information for the form stored in a JSON. I want to pass that to the backend but I am getting errors on how to make the POST request.
Here is what I've tried inside of a function:
I don’t use jquery Ajax like you are so I am not sure what your issue is. I use esriRequest to make restful calls to services. I would try switching to esriRequest. There are samples in the api you can follow.
I thought your service requires input parameters? If so you need to provide those to the esriRequest using query parameter.
If the request URL points to a web server that requires parameters, specify them here
When you open up the widget, there is a form for you to fill out. After you fill out the form, you have to hit the "Create Job" button. When you hit that, it triggers the execution of a certain function and inside that function is where I am putting this code in.
P.S. - I do have the dependencies ("esri/request", "esri/config", esriRequest, esriConfig) included in my code.