Ruby NetHTTP post




  • Avatar
    Xiao Li

    Hi trpdaddy,

    all card attributes should be specified like this: card[attribute],
    For your instance, use ‘card[name]’ should work.

    And, if you use ActiveResource instead of Net::HTTP, should be very easy to build API in ruby
    You can find some ruby examples here:


  • Avatar
    Jay Mitchell

    I always use net/https. Every time I've tried ActiveResource, it makes things more difficult. However, that could be due to my inexperience with ActiveResource. uses net/https.

    I use this snippet whenever I write API code to handle GET and POST. Here is an example of using that snippet:

      def post_murmur(text)

        post 'murmurs', 'murmur[murmur]' => text



      def post(resource, args)

        rest_connection.request_post("api/v2/projects/#{@project}/#{resource}.xml", args)


       def rest_connection, :username => @username, :password => @password)


  • Avatar
    Michelle Pace

    Hi LiXiao, I'm very keen to see these Mingle API with ruby examples. Your link unfortunately redirects to with no examples to be seen. Could you perhaps provide another link please, or directions on how to get to the examples? Thank-you in advance, Michelle

  • Avatar
    Michelle Pace

    Jay, thanks *very* much. I went from having no clue to being able to post a murmur. To add on to what you have posted, I'm not sure if it is what I'm suppose to be doing but in the least I get relevant xml back:

      def get_card(number)
        get 'cards', 'card[number]' => number

      def get(resource, args)
        rest_connection.request_get("api/v2/projects/#{@project}/#{resource}.xml", args)
      end i just have to work out what to next. =) thanks.

Please sign in to leave a comment.