Server Java, Client Ruby.

35 views
Skip to first unread message

Felipe Araujo

unread,
Oct 10, 2011, 8:16:43 AM10/10/11
to restfulie
Hi, friends, sorry for my horrible english. :)

I developed an application that receives a string via this post and
this parameter returns an xml. I would like to develop a ruby ​​on
using Restfulie client that consumes this feature, but I can not mount
the call Restfuilie.at ("my_method"). Post "My parameters".

How should I go to send the parameters correctly to the server?

Thank you!

Guilherme Silveira

unread,
Oct 10, 2011, 11:17:08 AM10/10/11
to rest...@googlegroups.com
Hi Felipe,

I just answered on twitter. You can try to .post( with a hash ).

Restfulie.at(uri).as('content_type').post({......})

Regards
Guilherme Silveira
Caelum | Ensino e Inovação
http://www.caelum.com.br/

Felipe Araujo

unread,
Oct 10, 2011, 1:02:00 PM10/10/11
to restfulie
Hi, Guilherme!!!

Thanks a lot for your answers.

Tonight I'll try and post feedback.

On 10 out, 12:17, Guilherme Silveira
<guilherme.silve...@caelum.com.br> wrote:
> Hi Felipe,
>
> I just answered on twitter. You can try to .post( with a hash ).
>
> Restfulie.at(uri).as('content_type').post({......})
>
> Regards
> Guilherme Silveira
> Caelum | Ensino e Inovaçãohttp://www.caelum.com.br/

Felipe Araujo

unread,
Oct 11, 2011, 9:16:22 AM10/11/11
to restfulie
Friends, could invoke the method in my application (VRaptor). The
problem is that when it comes to my controller my parameter is not
being recognized by VRaptor.
Following is the code:

Server:
@Post @Path(my_path)
public void autorizacao(String xml){
my_code_here...
}

Client:

xml = Hash["xml" => "<test></test>"]
response = Restfulie.at(my_location).as("application/text").post(xml)


[]'s

Guilherme Silveira

unread,
Oct 11, 2011, 9:27:21 AM10/11/11
to rest...@googlegroups.com

Guilherme Silveira

Guilherme Silveira

unread,
Oct 11, 2011, 9:28:12 AM10/11/11
to rest...@googlegroups.com

Felipe

Thats because applicayion/text is a text file. You want to send a application/form multipart (I forgot the name right now and am mobile but its the form multipart media type)

Regards

Guilherme Silveira

Felipe Araujo

unread,
Oct 11, 2011, 12:55:49 PM10/11/11
to restfulie
Guilherme, this is it!
Worked.
Thanks so much for your help.

On 11 out, 10:28, Guilherme Silveira
<guilherme.silve...@caelum.com.br> wrote:
> Felipe
>
> Thats because applicayion/text is a text file. You want to send a
> application/form multipart (I forgot the name right now and am mobile but
> its the form multipart media type)
>
> Regards
>
> Guilherme Silveira
Reply all
Reply to author
Forward
0 new messages