{"id":347,"date":"2011-06-04T12:08:40","date_gmt":"2011-06-04T17:08:40","guid":{"rendered":"http:\/\/muthii.com\/blog\/?p=347"},"modified":"2011-06-04T12:08:40","modified_gmt":"2011-06-04T17:08:40","slug":"httpservice-get-with-parameters","status":"publish","type":"post","link":"https:\/\/muthii.com\/blog\/?p=347","title":{"rendered":"HTTPService get with parameters"},"content":{"rendered":"<p>I was trying to put together a simple HTTPService Get service and most of the tutorials online did not work for me, as most of them are get calls without parameters and I needed to pass 2 to 3 arguments with my get call. Below is sample code for my get call.<\/p>\n<p>[cc lang=&#8221;actionscript3&#8243;]<br \/>\n<mx:HTTPService id=\"GetMyListing\"\n\t\turl=\"{hostname}\/rs\/client\/listing\"\n\t\tresult=\"handleResult(event)\"  method=\"GET\"\n\t\tfault=\"handleFault(event)\" \n\t\tresultFormat=\"e4x\" showBusyCursor=\"true\"  ><br \/>\n\t\t<\/mx:HTTPService><\/p>\n<p>private function getListings():void<br \/>\n{<br \/>\n   var params:Object = new Object;<br \/>\n   params[&#8220;Input&#8221;] = txtInput.text;<br \/>\n   params[&#8220;Index&#8221;] = new String(cmbSample.selectedIndex);<br \/>\n   GetMyListing.send(params);<br \/>\n}<br \/>\n[\/cc]<br \/>\n<strong>How does this work<\/strong><br \/>\nWhen the HTTPService executes it will convert the above call to<\/p>\n<p>http:\/\/localhost\/rs\/client\/listing?Input=sometxt&#038;Index=sometxt<\/p>\n<p>This way am not having to do a post call just to send two parameters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was trying to put together a simple HTTPService Get service and most of the tutorials online did not work for me, as most of them are get calls without parameters and I needed to pass 2 to 3 arguments with my get call. Below is sample code for my get call. [cc lang=&#8221;actionscript3&#8243;] private &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/muthii.com\/blog\/?p=347\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;HTTPService get with parameters&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[124],"tags":[125,126,128,127],"_links":{"self":[{"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/347"}],"collection":[{"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=347"}],"version-history":[{"count":8,"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":355,"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/347\/revisions\/355"}],"wp:attachment":[{"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/muthii.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}