### Install Pigeon HTTP Client Source: https://github.com/mekari-engineering/pigeon-http/blob/master/README.md Installs the Pigeon HTTP client gem using the RubyGems package manager. ```bash gem install pigeon-http ``` -------------------------------- ### GET Request with Query Parameters Source: https://github.com/mekari-engineering/pigeon-http/blob/master/README.md Demonstrates how to send a GET request with query parameters using the Pigeon HTTP client. Query parameters are only applicable for GET requests. ```ruby require 'pigeon-http' param: { foo: "bar" } client = Pigeon::Client.new('http_request') response = client.get('https://google.com', query: param) ``` -------------------------------- ### Basic GET Request with Pigeon Source: https://github.com/mekari-engineering/pigeon-http/blob/master/README.md Demonstrates how to create a Pigeon client and perform a basic GET request to a specified URL. ```ruby require 'pigeon-http' client = Pigeon::Client.new('http_request') response = client.get('https://google.com') ``` -------------------------------- ### Configure Pigeon HTTP Client Options Source: https://github.com/mekari-engineering/pigeon-http/blob/master/README.md Shows how to configure Pigeon client with various options such as request timeout, SSL verification, and retry settings. The `http_request` string is used for circuit breaker and Datadog monitoring. ```ruby options: { request_timeout: 60, # default value request_open_timeout: 60, # default value ssl_verify: false, # default value } client = Pigeon::Client.new('http_request', options: options) response = client.get('https://google.com') ``` ```ruby options: { retryable: false, # default value retry_threshold: 3 # default value } client = Pigeon::Client.new('http_request', options: options) response = client.get('https://google.com') ``` -------------------------------- ### POST Request with JSON Payload Source: https://github.com/mekari-engineering/pigeon-http/blob/master/README.md Demonstrates sending a POST request with a JSON payload using the Pigeon HTTP client. ```ruby require 'pigeon-http' payload: { foo: "bar" } client = Pigeon::Client.new('http_request') response = client.post('https://google.com', body: payload) ``` -------------------------------- ### POST Request with Form Data Payload Source: https://github.com/mekari-engineering/pigeon-http/blob/master/README.md Demonstrates sending a POST request with a multipart form data payload using the Pigeon HTTP client. ```ruby require 'pigeon-http' payload: { foo: "bar" } client = Pigeon::Client.new('http_request') response = client.post('https://google.com', form: payload) ``` -------------------------------- ### Set Environment Variables for Datadog Integration Source: https://github.com/mekari-engineering/pigeon-http/blob/master/doc/DATADOG.md Pigeon-HTTP requires specific environment variables to be set for the Datadog custom metric integration to function correctly. These variables include the StatsD host and port, along with Datadog environment and service names. ```shell STATSD_HOST= STATSD_PORT= DD_ENV= DD_SERVICE= ``` -------------------------------- ### Initialize Pigeon-HTTP Client with Custom Metric Namespace Source: https://github.com/mekari-engineering/pigeon-http/blob/master/doc/DATADOG.md When initializing the Pigeon-HTTP client, you must specify a request name. This name serves as the custom metric namespace in Datadog, allowing you to group related metrics. ```ruby p = Pigeon::Client.new('http_integration') ``` -------------------------------- ### POST Request with Form URL-encoded Payload Source: https://github.com/mekari-engineering/pigeon-http/blob/master/README.md Demonstrates sending a POST request with a URL-encoded form payload using the Pigeon HTTP client. ```ruby require 'pigeon-http' payload: { foo: "bar" } client = Pigeon::Client.new('http_request') response = client.post('https://google.com', query: payload) ``` -------------------------------- ### Retry Mechanism Calculation Source: https://github.com/mekari-engineering/pigeon-http/blob/master/README.md Explains the backoff time calculation for the retry mechanism in Pigeon, which is 4 raised to the power of the retry counter (n). ```mathematics 4**n ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.