Can i edit form request before submitting?

azp

Client
Регистрация
26.12.2012
Сообщения
52
Благодарностей
3
Баллы
8
After filling the form, can i,
instead of submitting it immediately ,
just build the POST request and put it into variable so i can modify it before sending ?

in other words:
1) i fill the form
2) click submit
2a) instead of submitting form a POST/GET request is built and put into variable
3) i edit variable
4) i submit modified request
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
  • Спасибо
Реакции: Tobbe

azp

Client
Регистрация
26.12.2012
Сообщения
52
Благодарностей
3
Баллы
8
In Perl when using LWP or WWW::Mechanize module for automation, there was such possibility to fill forms, prepare request but not send it , so it could be modified.
A few times it was handy, maybe an idea to implement in future in Zenno...
 

Tobbe

Client
Регистрация
01.08.2013
Сообщения
428
Благодарностей
148
Баллы
43
There's already a solution for that. And that's exactly what forms are for, "preparing a request".
Add / Remove / Edit / Copy / Fill however many fields you want in a form/source. Not before you submit will the data be sent. Just modify it before you submit.
Or do a POST request directly and skip the whole form modification process.
http://zennolab.com/wiki/en:actions:http
 

azp

Client
Регистрация
26.12.2012
Сообщения
52
Благодарностей
3
Баллы
8
Making POST/GET request using http://zennolab.com/wiki/en:actions:http requires you to manually craft such request, which is fine in most cases. But sometimes, such in my case, page is JS heavy (some stupid, fail safe JS framework that makes life harder), there are fields that are randomly generated, it is to much hassle to debug JS and learn how those fields/values are generated.
 

Tobbe

Client
Регистрация
01.08.2013
Сообщения
428
Благодарностей
148
Баллы
43
What I guess is randomly generated is the NAME attributes, which first can be grabbed and then used to build a POST request.
If they use JS to build the fields, you can work with the DOM instead of source to grab info from it.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 182
Баллы
113
If honestly then I do not believe that all attributes are generated randomly. Even in facebook where they generate attributes randomly is possible to find some unique ones to use every time.
And again if your resource is more into security than facebook then I'm more than sure they do not allow you to use their page without javascript enabled, what makes post/get requests useful.

Cheers
 

azp

Client
Регистрация
26.12.2012
Сообщения
52
Благодарностей
3
Баллы
8
It's a web control panel to some self hosted application which is under development which means source changes a lot. It uses JS framework that generates hidden control fields, checks everywhere if text has been entered manually. I do not think it is intended, it is a "feature" of this framework.
When i replace value field of form (<input type text value="asd") value displays as changed, but when i click next all data comes back to values entered from keyboard.
I am using keyboard emulation to overcome this and navigate thru 7 steps, but it could all be done with some source parsing and 1 post request as this is one page with 7 layers... But, at least for me, Zenno is not a tool to parse text, Perl is. Lets not waste time on this.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
And why you trying to manipulate DOM instead of filling fields?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)