[英]OutputStreamWriter alternative in Jenkins Active Choices Reactive Parameter
I am making a POST API call to proxmox for an authentication token but as soon as I use OutputStreamWriter inside the groovyscript for the active choices parameter it breaks. 我正在对proxmox进行POST API调用以获取身份验证令牌,但是当我在groovyscript中使用OutputStreamWriter时,它就会断开活动选择参数。 This currently works on Groovy Script IDE. 这当前适用于Groovy Script IDE。 Are there any alternatives to using the OutputStreamWriter?(it is the only way I have found that has enabled the query to return me the token when passing the params) 有没有使用OutputStreamWriter的替代方法?(这是我发现的唯一方法,它使得查询在传递参数时能够返回令牌)
def url = new URL(urlString)
def conn = url.openConnection()
conn.setDoOutput(true)
def writer = new OutputStreamWriter(conn.getOutputStream())
writer.write(paramString)
writer.flush()
Solved: 解决了:
You can get the response with the following code run on the master node: 您可以在主节点上运行以下代码来获取响应:
def command = 'curl -k -d root@pam&password=password $URL'
def response = command.execute().text
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.