[Mojolicious] curl works, Mojo::UserAgent doesn't

2020-05-13 Thread 'Michael Lackhoff' via Mojolicious
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

[Mojolicious] Re: curl works, Mojo::UserAgent doesn't

2020-05-14 Thread 'Michael Lackhoff' via Mojolicious
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

Re: [Mojolicious] Re: curl works, Mojo::UserAgent doesn't

2020-05-14 Thread 'Michael Lackhoff' via Mojolicious
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

Re: [Mojolicious] Re: curl works, Mojo::UserAgent doesn't

2020-05-14 Thread &#x27;Michael Lackhoff&#x27; via Mojolicious
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

Re: [Mojolicious] Re: curl works, Mojo::UserAgent doesn't

2020-05-14 Thread &#x27;Michael Lackhoff&#x27; via Mojolicious
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

[Mojolicious] Re: curl works, Mojo::UserAgent doesn't

2020-05-14 Thread &#x27;Michael Lackhoff&#x27; via Mojolicious
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