{"id":2660,"date":"2011-01-17T09:29:56","date_gmt":"2011-01-17T03:59:56","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=2660"},"modified":"2017-03-30T09:37:38","modified_gmt":"2017-03-30T04:07:38","slug":"server-to-server-post-request","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/server-to-server-post-request\/","title":{"rendered":"Server-to-server POST request"},"content":{"rendered":"<p>Server to server POST request can be made using <a href=\"http:\/\/hc.apache.org\/httpclient-3.x\/\" target=\"_blank\">Apache Commons HttpClient<\/a> library.<br \/>\nYou need to include http-client jar file in project\/lib folder and execute following lines of code:<\/p>\n<pre lang=\"groovy\">        \r\nHttpClient client = new HttpClient()\r\nString url = \"http:\/\/localhost:8080\/test\/person\/delete\/1\"\r\nPostMethod method = new PostMethod(url)\r\nint returnCode = client.executeMethod(method) \/\/Response Code: 200, 302, 304 etc.\r\ndef response = method.getResponseBodyAsString() \/\/ Actual response\r\n<\/pre>\n<p>Hope it helps<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Server to server POST request can be made using Apache Commons HttpClient library. You need to include http-client jar file in project\/lib folder and execute following lines of code: HttpClient client = new HttpClient() String url = &#8220;http:\/\/localhost:8080\/test\/person\/delete\/1&#8221; PostMethod method = new PostMethod(url) int returnCode = client.executeMethod(method) \/\/Response Code: 200, 302, 304 etc. def response [&hellip;]<\/p>\n","protected":false},"author":282,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1},"categories":[2348,7],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2660"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/282"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=2660"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/2660\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=2660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=2660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=2660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}