On Mon, Mar 2, 2009 at 6:50 PM, John Mettraux <[email protected]> wrote:
> On Mon, Mar 2, 2009 at 5:26 PM, kiko <[email protected]> wrote:
>>
>> the form-cli was a hack because the ruote-rest was failing if it was
>> other types of content-types so I needed to put some random content-
>> type, and the blank pdef argument was required for some reason I never
>> figured out.
>>
>> I made an attempt to launch the process as an httparty client.  Also I
>> don't get much of what you mean about your last response, it seems
>> your recommending using OpenWFE objects to create the xml or json text
>> on the client and send to the server?  My understanding is if you post
>> to http:<ruote-web2 server>/processes with parameter pdef_url to the
>> process file and parameter fields with a json representation of the
>> payload.  My issue is getting the authentication to work.
>
> Hello Francisco,
>
> I couldn't get Httparty to run with "application/json" for now. But
> this shell script works fine :
>
> ---8<---
> curl \
>  --verbose \
>  --basic --user "admin:admin" \
>  -H "Content-Type: application/json" \
>  -H "Accept: application/json" \
>  --data '{"pdef_url":"public/defs/sequence1.rb", "fields":{"a":"b"}}' \
>  http://localhost:3000/processes
> --->8---

And the "sudo gem install rest-client" equivalent :

---8<---
require 'rubygems'
require 'rest_client'

p RestClient.post(
  'http://admin:ad...@localhost:3000/processes',
  '{"pdef_url":"public/defs/sequence1.rb", "fields":{"a":"b"}}',
  :content_type => 'application/json',
  :accept => 'application/json')
--->8---

Sorry for having wasted your time with httparty.


Best regards,

-- 
John Mettraux   -   http://jmettraux.wordpress.com

--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to