Search documentation of Metastatic

# Metastatic.Semantic.Domains.Http (Metastatic v0.13.2)

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

Operation | Description
--- | ---
`:get` | HTTP GET request
`:post` | HTTP POST request
`:put` | HTTP PUT request
`:patch` | HTTP PATCH request
`:delete` | HTTP DELETE request
`:head` | HTTP HEAD request
`:options` | HTTP OPTIONS request
`:request` | Generic HTTP request
`:stream` | Streaming 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

register_all()

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).