Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

POST-ParseResponse

import groovy.json.JsonSlurper 

def post = new URL("https://pruebas.tressrevolution.com/revolutionapiesp/common/credencialesAuth").openConnection();
def message = 'grant_type=password&[email protected]&password=revolution1'
post.setRequestMethod("POST")
post.setDoOutput(true)
post.setRequestProperty("Content-Type", "Text")
post.getOutputStream().write(message.getBytes("UTF-8"));
def postRC = post.getResponseCode();

def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText(post.getInputStream().getText());
      
println(object.access_token);
if(postRC.equals(200)) {
    println("OK");
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.