HTTP
Last updated
Last updated
Generates the badge in SVG format from response of the given HTTP URL by processing the response with the given expression to resolve badge message. The steps are;
Takes HTTP URL and expression as input
Calls the given HTTP URL and gets the response
Processes the returned result with the given expression to resolve the badge message
Builds the badge from given label and resolve message to return to the client in SVG format
https://api.globadge.com/v1/badgen/http/{expressionType}?httpURL=<httpURL>&label=<label>&labelColor=<labelColor>&messageExpression=<messageExpression>&messageColor=<messageColor>
expressionType (*)
: The type of the expression to be used while resolving badge message from HTTP URL response by message expression. Currently, only jq
expressions are supported. This parameter is passed as path parameter and it is mandatory.
httpURL (*)
: The HTTP URL to be called with GET method for getting the response which will be used to resolve badge message by message expression. This parameter is passed as query parameter and it is mandatory.
label (*)
: The text of the badge label. This parameter is passed as query parameter and it is mandatory.
messageExpression (*)
: The expression to be used for resolving badge message from the response of the HTTP URL. The expression must be valid in the context of the expression type passed as path parameter as mentioned above. Currently, only jq
expressions are supported. This parameter is passed as query parameter and it is mandatory.
labelColor
: The color of the badge label. The supported colors are listed . This parameter is passed as query parameter and it is optional.
messageColor
: The color of the badge message. The supported colors are listed . This parameter is passed as query parameter and it is optional.
Given HTTP URL is called only by GET
method and it is not configurable by parameters.
Badge responses are cached during 5 minutes. So, even if the given HTTP URL returns different result, you will get the same badge response during 5 minutes (if the link has the same message expression and label parameters)
The following example gets the latest version of the OpenTelemetry AWS Lambda Collector layer from Github releases:
expressionType
: jq
httpURL
: https://api.github.com/repos/open-telemetry/opentelemetry-lambda/releases
label
: Collector
messageExpression
:
Note: Given parameters as part of the whole URL needs to be encoded as shown below.