hi guys,

  Just started on a project with Mojolicious.

Task: to upload a file into mojo and then issue a PUT command to transfer 
that file to a file server.

I have been struggling to find documentation on using put_p/put in terms of 
the parameters for the syntax.

Often, looking at https://mojolicious.org/perldoc/Mojo/UserAgent#put_p, it 
is too brief and not concise.
 I have also tried to look for the source code in the Mojolicious framework 
which does the actual put_p/put to no avail. I had looked up the source of 
Mojo <https://mojolicious.org/perldoc/Mojo> :: UserAgen 
<https://mojolicious.org/perldoc/Mojo/UserAgent>t and the packages it is 
"use"-ing also to no avail.

--------
   $self->ua->put_p(
            
           # my_target_url_object is a Mojo::URL with the
           # user info and actual url of the
           # file server defined.

           # $file_object is a Mojo::File::Asset representing a file I had 
uploaded from my local machine

*            $my_target_url_object => form => {*

*                'content' => $file_object->asset->{'content'},            
}*
        )->then(
        sub ($tx) {
            return $self->parse_response_p($tx);
        }
    )->catch(
        sub($error) {
            p->reject("Connection error: $error");
        }
    );
-----------
When I use the put call above,  the content of my input file becomes 
"content=+Why+Georgia%3F%0A" instead of just "Why Georgia" (which was what 
I had uploaded earlier).
I must be doing something wrong.

 I have since tried many variations  to the call to put_p to no avail.
Sometimes, if i do not provide the hash key, 'content', the actual cost 
when i cat the file in the target webserver directory would be literally 
'HASH%3234234234';

Can any one please point me to proper documentation clearly describing how 
to execute a put/put_p in a  Mojolicious controller?

Thank you, guys


Gordon 





-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/19d370c9-81e3-4a52-aac9-254eef693bb8n%40googlegroups.com.

Reply via email to