Metastatic.Semantic.Domains.Http (Metastatic v0.10.4)

View Source

HTTP client operation patterns for semantic enrichment.

This module defines patterns for detecting HTTP client operations across multiple languages and HTTP client libraries. Patterns are registered with the Metastatic.Semantic.Patterns registry at module load time.

Supported Libraries

Elixir

  • HTTPoison - HTTPoison.* operations
  • Req - Req.* operations
  • Tesla - Tesla.* operations
  • Finch - Finch.* operations
  • Mint - Low-level HTTP client

Python

  • requests - requests.* operations
  • httpx - httpx.* operations (sync and async)
  • aiohttp - Async HTTP client
  • urllib - Standard library

Ruby

  • Net::HTTP - Standard library
  • HTTParty - HTTParty.* operations
  • Faraday - Faraday.* operations
  • RestClient - RestClient.* operations

JavaScript

  • fetch - Native Fetch API
  • axios - axios.* operations
  • got - got.* operations
  • node-fetch - Node.js fetch implementation
  • superagent - superagent.* operations

HTTP Operations

OperationDescription
:getHTTP GET request
:postHTTP POST request
:putHTTP PUT request
:patchHTTP PATCH request
:deleteHTTP DELETE request
:headHTTP HEAD request
:optionsHTTP OPTIONS request
:requestGeneric HTTP request
:streamStreaming HTTP request

Pattern Structure

Each pattern is a tuple of {pattern, spec} where:

  • pattern - String or Regex to match function names
  • spec - Map with operation details:
    • :operation - The HTTP operation type
    • :framework - The HTTP library identifier
    • :extract_target - Strategy for extracting URL/endpoint

Summary

Functions

Registers all HTTP patterns for all languages.

Functions

register_all()

@spec register_all() :: :ok

Registers all HTTP patterns for all languages.

Called automatically when the module is loaded. Can also be called manually to re-register patterns (e.g., after clearing).