Announcement

Collapse
No announcement yet.

Restful Help?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Restful Help?

    I am able to get mirth to use the post method and send a parameter to a restful resource without error and my parameters come across like this:

    Code:
    Parameters: {"name"=>"PATIENT MF", "format"=>"xml", "action"=>"create", "controller"=>"players"}
    However, im using this against a rails app and it is expecting a "nested" parameter of sorts like the below which was generated with RESTClient2.2 (and works):

    Code:
    Parameters: {"player"=>{"name"=>"PATIENT MF" }, "format"=>"xml", "action"=>"create", "controller"=>"players"}
    Is there a way to craft my name value pairs to have it resemble the request above ?

    I tried coming this forum a bit and older mirth version tricks such as mapping the whole xml doc to a variable do not work for me... though this is an ok alternative to just post the whole xml doc which looks nothing more than the below:


    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
      <player>
        <name>Ron Sweeney</name>
        
      </player>
    And no, im not using Mirth against a fantasy football league jbartels !

  • #2
    Re:Restful Help?

    The parameter nesting you're seeing is not an HTTP thing, its a Rails-ism.

    Pass your params like this:

    Code:
    player[name]=smitty
    and rails turns it into:

    Code:
    :«»player => {:name => smitty }
    Post edited by: jbartels, at: 11/20/2008 11:21
    Jon Bartels

    Zen is hiring!!!!
    http://consultzen.com/careers/
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.

    Comment

    Working...
    X