SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
807 stars 171 forks source link

Restheart #54

Closed Qahraman closed 9 years ago

Qahraman commented 9 years ago

how can i send post request with using java http request? I want insert any value in my collection.have any example for this?

mkjsix commented 9 years ago

We often use the Apache HttpClient v. 4.x, but any decent Java HTTP or REST client library will work.

RESTHeart's integration tests suite is a good starting point for examples: https://github.com/SoftInstigate/restheart/tree/develop/src/test/java/org/restheart/test/integration There we use the org.apache.http.client.fluent.Executor

Specifically, have a look at the following class: https://github.com/SoftInstigate/restheart/blob/develop/src/test/java/org/restheart/test/integration/PutDocumentIT.java

Note: in RESTHeart's semantic model you must PUT a document to a collection, not POST.

PS. Python client sample code is available as well: https://github.com/SoftInstigate/restheart-python-test

Qahraman commented 9 years ago

Thanks for all.