All Projects → jenkinsci → Http Request Plugin

jenkinsci / Http Request Plugin

Licence: mit
This plugin does a request to an url with some parameters.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Http Request Plugin

Gitlab Branch Source Plugin
Jenkins-Plugin to create a multi-branch-project from gitlab
Stars: ✭ 76 (-38.71%)
Mutual labels:  plugin, jenkins
Axbaseplugin
Android Plugin Framework
Stars: ✭ 122 (-1.61%)
Mutual labels:  plugin
Tfsnotificationrelay
An extensible plugin for TFS that sends notifications to Slack, HipChat and IRC
Stars: ✭ 120 (-3.23%)
Mutual labels:  plugin
Vim Qfreplace
Perform the replacement in quickfix.
Stars: ✭ 121 (-2.42%)
Mutual labels:  plugin
Activity Log
Get aware of any activities that are taking place on your dashboard! Imagine it like a black-box for your WordPress site.
Stars: ✭ 119 (-4.03%)
Mutual labels:  plugin
Figma Theme Ui
Convert a Theme UI config to Figma Styles
Stars: ✭ 122 (-1.61%)
Mutual labels:  plugin
Pkhex Plugins
Plugins for PKHeX
Stars: ✭ 118 (-4.84%)
Mutual labels:  plugin
Uppload
📁 JavaScript image uploader and editor, no backend required
Stars: ✭ 1,673 (+1249.19%)
Mutual labels:  plugin
Gitwebhookproxy
A proxy to let webhooks reach running services behind a firewall – [✩Star] if you're using it!
Stars: ✭ 123 (-0.81%)
Mutual labels:  jenkins
Mattermost Plugin Remind
a mattermost plugin that sets reminders for users and channels.
Stars: ✭ 121 (-2.42%)
Mutual labels:  plugin
Vite ruby
⚡️ Vite.js in Ruby, bringing joy to your JavaScript experience
Stars: ✭ 112 (-9.68%)
Mutual labels:  plugin
Plugins
Community curated plugins for c-lightning
Stars: ✭ 120 (-3.23%)
Mutual labels:  plugin
Delivery Pipeline Plugin
Jenkins plugin for pipeline visualisation, perfect for Continuous Delivery
Stars: ✭ 122 (-1.61%)
Mutual labels:  jenkins
Jetty Runner
A plugin that allows you to run Jetty from IntelliJ
Stars: ✭ 119 (-4.03%)
Mutual labels:  plugin
Gradle Maven Plugin
Gradle 5.x Maven Publish Plugin to deploy artifacts
Stars: ✭ 124 (+0%)
Mutual labels:  plugin
Ci Matters
Integration (comparison) of different continuous integration services on Android project
Stars: ✭ 119 (-4.03%)
Mutual labels:  jenkins
Hyperdrive
This repository has moved to:
Stars: ✭ 120 (-3.23%)
Mutual labels:  plugin
Xcode Build Times
This BitBar/SwiftBar plugin shows the time you spend waiting for Xcode to do your builds
Stars: ✭ 122 (-1.61%)
Mutual labels:  plugin
Sportspress
An open source league statistics plugin for WordPress created by ThemeBoy.
Stars: ✭ 124 (+0%)
Mutual labels:  plugin
Rabbitmq Prometheus
A minimalistic Prometheus exporter of core RabbitMQ metrics
Stars: ✭ 124 (+0%)
Mutual labels:  plugin

[[http-request-plugin]] = Http Request Plugin :toc: macro :toc-title: HTTP Request Plugin ToC ifdef::env-github[] :tip-caption: 💡 :note-caption: ℹ️ :important-caption: ❗️ :caution-caption: 🔥 :warning-caption: ⚠️ endif::[]

link:https://ci.jenkins.io/job/Plugins/job/http-request-plugin/job/master/[image:https://ci.jenkins.io/job/Plugins/job/http-request-plugin/job/master/badge/icon[Build]] link:https://github.com/jenkinsci/http-request-plugin/graphs/contributors[image:https://img.shields.io/github/contributors/jenkinsci/http-request-plugin.svg?color=blue[Contributors]] link:https://plugins.jenkins.io/http_request/[image:https://img.shields.io/jenkins/plugin/i/http_request.svg?color=blue&label=installations[Jenkins Plugin Installs]] link:https://plugins.jenkins.io/http_request/[image:https://img.shields.io/jenkins/plugin/v/http_request.svg[Plugin]] link:https://github.com/jenkinsci/http-request-plugin/releases/latest[image:https://img.shields.io/github/release/jenkinsci/http-request-plugin.svg?label=changelog[GitHub release]]

toc::[]

[abstract] .Overview This plugin sends a HTTP/HTTPS request to a user specified URL. The request is made as a job execution in Jenkins and depending of the HTTP response the job could be marked as failed (configurable). For example, responses such as 404 and 500 could make the job fail. When a job fails it will log the response to help identify the problem. The request may be as an HTTP GET or POST mode, by choosing the HTTP mode. If it was not informed, it will use the default from global settings whose default is POST.

== Features

The following features are available in both Pipeline and traditional project types:

  • Programmable HTTP method: GET, POST, PUT, PATCH, DELETE, or HEAD
  • Programmable range of expected response codes (a response code outside the range fails the build)
  • Supports Basic Authentication (see global configuration)
  • Supports Form Authentication (see global configuration)
  • You can specify a string that must be present in the response (if the string is not present, the build fails)
  • You can set a connection timeout limit (build fails if timeout is exceeded)
  • You can set an "Accept" header
  • You can set a "Content-Type" header
  • You can set any custom header

=== Basic plugin features

[NOTE] .Feature Availability

The following features are only present in the non-pipeline version of the plugin. For the Pipeline version, these features are available programmatically.

  • You can send the build parameters as URL query strings
  • You can store the response to a file, built-in to the plugin

=== Pipeline features

In a Pipeline job, you have total control over how the url is formed. Suppose you have a build parameter called "param1", you can pass it to the HTTP request programmatically like so:

[source,groovy]

httpRequest "http://httpbin.org/response-headers?param1=${param1}"

If you wish to save the response to a file, you need to grab a workspace. You can do this with a node Pipeline step. For example:

[source,groovy]

def response = httpRequest "http://httpbin.org/response-headers?param1=${param1}" node() { writeFile file: 'response.txt', text: response.content }

You can access the response status code and content programmatically:

[source,groovy]

def response = httpRequest "http://httpbin.org/response-headers?param1=${param1}" println('Status: '+response.status) println('Response: '+response.content)

You may also send content in the body of the request, such as for a PATCH request:

[source,groovy]

// create payload def patchOrg = """ {"description": "$description"} """ def response = httpRequest acceptType: 'APPLICATION_JSON', contentType: 'APPLICATION_JSON', httpMode: 'PATCH', requestBody: patchOrg, url: "https://api.github.com/orgs/${orgName}"

You can also set custom headers:

[source,groovy]

def response = httpRequest customHeaders: [[name: 'foo', value: 'bar']]

For details on the Pipeline features, use the Pipeline snippet generator in the Pipeline job configuration.

[WARNING] .Known Limitations

If Jenkins is restarted before the HTTP response comes back, the build will fail.

== Building

The plugin can be built and tested locally using a Maven Docker container:

[source, bash]

docker run -it --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.3-jdk-8 mvn test

== Configure Global Settings

image::docs/images/configure-http-request-global.png[]

== Configure Build Step in your Jenkins job

image::docs/images/configure-http-request-build-step.png[]

== HTTP Request Parameters

Parameters are escaped, which means if you try to pass another value inside a value, it will not happen.

In the example below, the key "name" will be passed with a value of "jenkins&os=linux". Note that "os" is not a parameter - it is part of the value). At the HTTP server-side no parameter named "os" will exist.

[CAUTION] .Regarding Logging & Sensitive Information

Every execution will log all parameters. Be careful to not pass private information such as passwords or personal information.

image:docs/images/log.png[]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].