It is possible to start HTTP Get with collect all data into Map and HTTP Post with all data as Parameters?

Hi,

I’ve a new question about a HTTP Get with collect all data into Map and HTTP Post with all data as Parameters.

In my case I would edit a web form page (Atlassian JIRA {Issue}). The problem, i can’t edit one value with HTTP post - I must sent a HTTP post with ALL existing parameters. Otherwise the missing data will be deleted.

So I want to start a first HTTP request and get all given data (into map?!) and further start a new HTTP request within map given data (for example one oder two values changed in the map).

Is that possible in a easy way?

Many many thanks!

Depends on your definition of easy.

The way the browser does (most of the time) it is the DOM. There is a form that is going to be submitted, and within that form are a number of form controls. By parsing the HTML, the browser knows what needs to be sent.

In order for you to do what you want to do, you are going to have to duplicate that. This is actually pretty easy, using CSS selectors. However, it is going to require some thought on your part. Are you going to try to write your scenario so that it works equally well no matter how many different fields are provided on the form? Or are you okay with hard-coding the list of fields that you need to extract and send back?

If you decide that hard-coding is not the solution, then you get to be creative and exercise your scala skills and figure out a way to extract form elements using .findAll, and then iterate over them to build the appropriate data structure that you can throw at .post() in order to get the desired results. If you decide to do that, I’d love to see the solution you come up with.