Answers for "jenkins curl to string"

0

jenkins curl to string

pipeline {
    agent any

    stages {
        stage("Using curl example") {
            steps {
                script {
                    final String url = "http://localhost:8080/job/Demos/job/maven-pipeline-demo/job/sdkman/2/api/json"

                    final String response = sh(script: "curl -s $url", returnStdout: true).trim()

                    echo response
                }
            }
        }
    }
}
Posted by: Guest on February-25-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language