试图在Jenkins上运行HTTP POST请求

时间:2017-05-31 17:20:58

标签: jenkins

我目前在Jenkins遇到问题,我的工作中有这样的配置:

image

但是当我执行作业时,得到以下输出:

Building in workspace /var/lib/jenkins/workspace/Project1.0
HttpMethod: POST
URL: mypagehome.php
ERROR: Build step failed with exception
java.net.MalformedURLException: no protocol: page.php
at java.net.URL.<init>(URL.java:593)
at java.net.URL.<init>(URL.java:490)
at java.net.URL.<init>(URL.java:439)
atjenkins.plugins.http_request.HttpRequestExecution.authAndRequest(HttpRequestExecution.java:215)
at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:187)
Caused: java.lang.IllegalStateException
at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:190)
at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:61)
at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
at jenkins.plugins.http_request.HttpRequest.perform(HttpRequest.java:304)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Build step 'HTTP Request' marked build as failure
Finished: FAILURE

我是Jenkins的新手,直到今天我知道可以用它发出http请求,你知道我能做错什么吗? 谢谢!

编辑:我知道,这意味着http协议,所以我添加了它,现在我收到了这个错误:处理UnknownHostException(mypage.php:名称或服务未知)为404 Not发现很抱歉这是一个菜鸟,你可以帮帮我吗

1 个答案:

答案 0 :(得分:1)

它说

  

java.net.MalformedURLException:no protocol:page.php

那么将mypage.php(错误和屏幕截图不同?)更改为有效的网址,例如http://localhost/mypage.php(或此端点所在的位置)。