<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 2013/1/30 0:10, nicoktay wrote:<br>
    </div>
    <blockquote cite="mid:1359475858347-4021927.post@n3.nabble.com"
      type="cite">
      <pre wrap="">Hi all,

I was trying to use POST method of REST API to create new asset and insert
it into guvnor as in the document 
<a class="moz-txt-link-freetext" href="http://docs.jboss.org/drools/release/5.5.0.Final/drools-guvnor-docs/html/ch09.html#d0e3500">http://docs.jboss.org/drools/release/5.5.0.Final/drools-guvnor-docs/html/ch09.html#d0e3500</a>
<a class="moz-txt-link-rfc2396E" href="http://docs.jboss.org/drools/release/5.5.0.Final/drools-guvnor-docs/html/ch09.html#d0e3500">&lt;http://docs.jboss.org/drools/release/5.5.0.Final/drools-guvnor-docs/html/ch09.html#d0e3500&gt;</a>  

Below I tried to create new asset using POST, please guide me where I was
wrong.

WebClient client =
WebClient.create(<a class="moz-txt-link-rfc2396E" href="http://127.0.0.1:8080/">"http://127.0.0.1:8080/"</a>,"admin","admin",null);
       
Response response=
client.path("guvnor-5.4.0.Final-jboss-as-7.0/rest/packages/mortgages/assets/newtechnicalrule.drl").accept("text/plain").post(rule);
// rule is string drl which will be created with the name of
"newtechnicalrule.drl".</pre>
    </blockquote>
    When you use POST to create an asset, the correct url is <a
      class="link"
href="http://localhost:8080/guvnor-5.5.0.Final/rest/packages%7BpackageName%7D/assets"
      target="">http://localhost:8080/guvnor-5.5.0.Final/rest/packages{packageName}/assets</a><br>
    <p> The POST method produces MIME-Types of application/atom+xm, not
      "text/plain"<br>
    </p>
    <p>Cheers,<br>
      Jervis<br>
    </p>
    <ul>
      <li><br>
      </li>
    </ul>
    <br>
    <blockquote cite="mid:1359475858347-4021927.post@n3.nabble.com"
      type="cite">
      <pre wrap="">

Welcome to any help thanks,

Nicoktay.



--
View this message in context: <a class="moz-txt-link-freetext" href="http://drools.46999.n3.nabble.com/REST-API-new-asset-tp4021927.html">http://drools.46999.n3.nabble.com/REST-API-new-asset-tp4021927.html</a>
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>