On 2013/1/30 0:10, nicoktay wrote:
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 
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>  

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

WebClient client =
WebClient.create("http://127.0.0.1:8080/","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".
When you use POST to create an asset, the correct url is http://localhost:8080/guvnor-5.5.0.Final/rest/packages{packageName}/assets

The POST method produces MIME-Types of application/atom+xm, not "text/plain"

Cheers,
Jervis



Welcome to any help thanks,

Nicoktay.



--
View this message in context: http://drools.46999.n3.nabble.com/REST-API-new-asset-tp4021927.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users