0

In a Rails app, I need to read a seed number from another application and then update the seed by 1 using a REST interface. I'm using the gem 'rest-client'.

I can read the seed number OK using this:

      <% xml_data = RestClient.get "http://www.xxxxx.com/maxrest/rest/os/mxautokey?_lid=mxintadm&_lpwd=mxintadm&autokeyname=WORKORDERNUM&ORGID=AAAA" %>
      <% doc = Nokogiri::XML(xml_data)%>
      <% prefix = doc.at("PREFIX").text %>
      <% seed = doc.at("SEED").text %>
      <% wonum = prefix + seed %>

But, I'm trying to put back a new seed using this (at first I'm just trying to use a hard coded number):

<% RestClient.put "http://www.xxxxx.com/maxrest/rest/os/mxautokey?_lid=mxintadm&_lpwd=mxintadm&autokeyname=WORKORDERNUM&ORGID=AAAA", {:seed => 38980} %>

I get back - 400 Bad Request

I appreciate the help!

4

0 回答 0