Skip to content

Instantly share code, notes, and snippets.

@mahbub-shohag
Created July 9, 2019 08:50
Show Gist options
  • Save mahbub-shohag/4288dbdee2d39b944c6e0ea02403e0bf to your computer and use it in GitHub Desktop.
Save mahbub-shohag/4288dbdee2d39b944c6e0ea02403e0bf to your computer and use it in GitHub Desktop.
Add plugin in dependency plugin : compile "org.grails.plugins:rest-client-builder:2.1.1"
def sms(){
def rest = new RestBuilder()
MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>()
form.add("UserID", "****")
form.add("Passwor", "******")
form.add("stuID", "*******")
def resp = rest.post("http://localhost:8087/bankapi/student/CheckId") {
accept JSONObject, 'application/json'
contentType("application/x-www-form-urlencoded")
body(form)
}
def json = resp.json
System.out.println(json)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment