I am using sitebricks-client to interact with REST APIs in Java. I need to do a POST with a non-empty body. How do I do that in sitebricks?
How to post body in sitebricks-client?
320 Views Asked by pathikrit At
2
There are 2 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in REST
- Spring RestTemplate passing the type of the response
- .net rest service with JSON string and consumed with java client
- SuiteCRM how to retrieve all account related contacts
- http status code for failed email send
- cloud foundry - 413 Request Entity Too Large
- Why does PHP add "\r\n" to an empty string?
- WCF Service not accepting multiple body parameters
- How to send Rest GET request that contains "#" value in url parameters?
- Phalcon PHP - RESTful API
- Object of class CS_REST_Wrapper_Result could not be converted to string in CAMPAIGN MONITOR
- purchase individual items and subscriptions in the same PayPal REST API transaction
- Empty Response Received on Android POST Request
- angular load more tweets onclick
- Async vs Horizontal scaling
- Responding to an Office 365 event invite via REST
Related Questions in POST
- Jquery on submit ajax post needs two clicks in IE
- cleaning a post URL from an Array
- AJAX xmlhttp.open sumit data using POST method
- Check if POST is succesfull (Android)
- shell cript in php code
- Recover the data already recorded in my Django admin space in my form
- post request (with body) in node.js
- issues using htmlspecialchars($_POST['']) to keep data on value after submitting
- How do you Request[""] with a Dynamic Variable? Request["@Variable"]?
- PHP Curl json POST not working for me
- difference between youtube's request and mine
- Upload Image / Make Post Request via curl + scrot + xclip
- POST the values of several html <input type='button'>
- Actionscript 3 Air iOS POST data not sending with URLLoader
- Laravel throwing error on foreach() loop on POST
Related Questions in REST-CLIENT
- Unable to post information to asp.net MVC controller using postman
- Not Able to consume external RestFul web service from Client in Eclipse or from restclient-ui
- RestClient::MethodNotAllowed: 405 Method Not Allowed GET response
- rest-client gem doesnt work with Cloudflare SSL certificate
- ruby RestClient per request settings
- Handling Response Output of REST Client in grails
- RestClient Behind Firewall
- Sending an array of string in a request made with rest-client gem
- Java - REST Client
- using Rest client and getting statuscode 406 not acceptable
- translation from XML to rest-client for POST request
- Twilio error, resource not found when looking up SMS by SID
- Which RESTful framework will suit the Android and the Server-side as well?
- access token request with box api
- Why my rest endpoint receives empty dto
Related Questions in SITEBRICKS
- How to test Reply<?> in sitebricks
- Sitebricks file download service throws AccessControlException - access denied
- How to handle HTTP response with a 4xx/5xx status code, Java servlet/HttpURLConnection
- Sitebricks and Channel Presence Service (GAE); Also having trouble with normal servlets
- How to sends multiple object over JSON from sitebricks client to sitebricks REST Service?
- Upgrading open source libraries in Web application
- How to exclude a URL when registering filters in ServletModule.configureServlets?
- Build sitebricks with maven
- Howto make a dynamic web module with sitebricks and annotations?
- How to automate retrieval of DTOs from Sitebircks service
- How to send payload data using sitebricks web client using http delete method
- Method interception or validation of request params in Sitebricks controller
- Can sitebricks be configured to not say "Sitebricks received a null reply from the resource..."?
- embed header and footer in all html page using google sitebricks @embed
- How to generate an HTML table in Sitebricks?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You have not specified what kind of request body you are trying to post. If you are trying to send a String with a Content-Type of "text/plain", then the following should work:
If you are trying to send data of a particular type that you have already serialized to a String, you can set the Content-Type header manually:
If you have a Map containing data that you would like to send to the server with a Content-Type of "application/json", then something like this might be up your alley:
There are two important points to pay attention to in the examples above:
postmethod should be of the type passed to thetransportsmethod.overmethod determines the default value of the Content-Type header and the way in which the value passed to thepostmethod is serialized. The class should be a subclass ofcom.google.sitebricks.client.Transport, and you will probably want to choose one of the classes found in thecom.google.sitebricks.client.transportpackage.