Skip to content

Creating Requests in Martini's HTTP Client

Martini’s HTTP Client enables developers to configure and test HTTP requests, making it easier to interact with external APIs and web services. This document outlines the steps for creating requests, including configuring methods, headers, parameters, and payloads.

Steps to Create an HTTP Request

  1. Access the HTTP Client:

    • Open the HTTP Client: In Martini Designer, navigate to the HTTP Client from the left-hand navigation bar.
    • Create a New Request: Select the "New Request" icon to start configuring a new HTTP request.
  2. Configure Request Details:

    • Set the HTTP Method: Choose the HTTP method for the request (e.g., GET, POST, PUT, DELETE) based on the operation you want to perform.
    • Enter the Request URL: In the URL field, enter the endpoint of the external API or service. You can use environment variables or parameters as needed.
  3. Add Headers:

    • Open the Headers Section: Click the "Headers" tab in the HTTP Client.
    • Specify Custom Headers:
      • Add headers such as Content-Type, Authorization, or any other headers required by the API.
      • Set values directly or use variables for headers that may change dynamically.
  4. Define Parameters:

    • Open the Parameters Section: Click the "Parameters" tab in the HTTP Client.
    • Query Parameters:
      • For GET requests or requests with URL parameters, enter query parameters in the designated section.
      • Martini will automatically append these parameters to the request URL.
    • Path Parameters: If the URL includes path variables, define them in the parameters section to allow Martini to substitute them correctly in the URL.
  5. Manage Request Cookies:

    • Open the Cookies Section: Click the "Cookies" tab in the HTTP Client.
    • Add or Modify Cookies:
      • Similar to headers, you can manage request cookies here.
      • Add new cookies, or edit existing ones to include any values required by the API.
  6. Set the Request Body:

    • Open the Body Section: Click the "Body" tab in the HTTP Client.
    • Body Format: For POST, PUT, or PATCH requests, select the body format (e.g., JSON, XML, form data) from the dropdown as required by the API.
    • Add Payload Data: Enter the payload data directly in the body section.
  7. Authentication:

    • Open the Authentication Section: Click the "Authentication" tab in the HTTP Client.
    • Select Authentication Method: Choose an authentication method from the dropdown (Basic Authentication, OAuth1, or OAuth2).
      • Basic Authentication: Enter the username and password.
      • OAuth1: Enter OAuth1 credentials as required by the API.
      • OAuth2: Enter your Access Token. For APIs that use Bearer token authentication, there’s no need to specify "Bearer" in the header manually—the HTTP Client automatically generates the appropriate Bearer token header when sending the request using the Access Token.
  8. Send the Request:

    • Send the Request: Click the "Send" button to execute the request.
    • Review the Response:
      • The HTTP Client displays the response status, headers, and body.
      • Use this information to verify the request behavior or make any needed adjustments.
  9. Save the Request (Optional):

    • Save: Click the Save icon in the main navigation bar to save the request in Martini, either for the Workspace or the User.

Quick Invocation of Martini APIs, Services, or Workflows

Martini’s HTTP Client also offers a convenient way to quickly invoke any Martini API, Service, or Workflow directly from the Navigator or API Editor. This functionality is useful for testing or debugging without needing to manually configure each request.

Steps to Invoke in HTTP Client

  1. Invoke a Service or Workflow:

    • In the Navigator, locate the Service or Workflow you want to test.
    • Right-click the Service or Workflow, then select "Invoke in HTTP Client" from the context menu.
    • Martini will automatically open the HTTP Client with the request configured for the selected Service or Workflow, ready to be invoked.
  2. Invoke an API Operation:

    • Open the API Editor and navigate to the specific Operation you wish to invoke.
    • Right-click on the Operation, then select "Invoke in HTTP Client".
    • The HTTP Client will open with the Operation pre-configured, allowing you to quickly test the endpoint.

Additional Resources

  • Postman Collections: Import or Export a Postman collection to/from Martini's HTTP Client.
  • Export as Service: Export the request as a service for reuse in workflows and other integrations.