I had quite a bit of success recently using Mojo::UserAgent so I tried to
replace a curl command to do a backup of my Fritz.box router with M::U.
Here is the curl command:
curl -s -k -o $OUT --form sid=$SID --form ImportExportPassword=$BAKPWD \
--form ConfigExport= http://fritz.box/cgi-bi
the HTML page back,
indicating that something went wrong.
I can only spot very minor differences that is why I am running out of
ideas:
- the boundary used by M::U is quite short
- the form parameters are not in the same order
- Accept-Encoding header (is also sent from Firefox where it works)
- the diffe
ay 14, 2020, at 07:38, 'Michael Lackhoff' via Mojolicious <
> mojol...@googlegroups.com > wrote:
>
>
>
> Am 14.05.2020 um 05:08 schrieb Stefan Adams:
>
> > I'm certain you'll be able to accomplish this with M::UA. Can you share
>
> Just
Am Donnerstag, 14. Mai 2020 14:23:41 UTC+2 schrieb Felipe Gasper:
> The idea is more that, if you know curl is doing what you want, then just
> use curl rather than M::UA, and keep on trucking with all else that Mojo
> has to offer.
>
Of course you are right. Your suggestion would be the m
I think I am getting closer.
When I change the sequence of the form parameters in curl, it fails in the
same way. So I guess the sequence is important and my question now is:
Is there a way to pass the form parameters with fixed sequence in M::U
(the form-hash of course has a random order)? Pe
Ok, got it :-
1. get the content-parts:
$tx->req->content->parts;
2. by checking each parts body_contains method identify them
3. build a new parts array with correct sequence by copying the objects
into a new array.
4. change the whole thing:
$tx->req->content->parts($sorted_parts);
This reques