🦖
@t-req/core
The HTTP request library for .http files. Parse, interpolate, and execute HTTP requests programmatically.
Quick Example
Section titled “Quick Example”### Get user information# @name getUserGET {{baseUrl}}/users/{{userId}}Authorization: Bearer {{authToken}}Accept: application/jsonimport { createClient } from '@t-req/core';
const client = createClient({ variables: { baseUrl: 'https://api.example.com', userId: '123', authToken: process.env.API_TOKEN, },});
const response = await client.run('./api.http');console.log(response);Why @t-req/core?
Section titled “Why @t-req/core?”- Familiar Format: Use the same
.httpfiles you already have from VS Code or JetBrains - Portable: Run your HTTP files in any JavaScript runtime
- Testable: Write integration tests using your existing request definitions
- Scriptable: Automate API workflows with full programmatic control