tsentials-http

Convert HTTP requests into typed Result<T> outcomes with RequestBuilder.

49|Updated May 12, 2026
One-click install
npx skills add https://github.com/senrecep/tsentials --skill tsentials-http
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsentials-http
Source: https://github.com/senrecep/tsentials/tree/main/.well-known/agent-skills/tsentials-http
Command: npx skills add https://github.com/senrecep/tsentials --skill tsentials-http

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It eliminates repetitive error handling in TypeScript HTTP calls by returning a Result<T> for both success and failure responses instead of throwing exceptions or forcing manual try/catch logic.

Core Features & Use Cases

  • fetchResult wrapper: Perform get/post/put/patch/delete requests and receive Promise<Result<T>> where 2xx becomes success and 4xx/5xx becomes failure.
  • RequestBuilder fluent API: Build headers, query parameters, and JSON or raw bodies with a terminal .send<T>() call for typed responses.
  • Error mapping and parsing: Convert HTTP status codes into AppError via httpStatusToError and extract human-readable details from RFC 9457 ProblemDetails via extractErrorDescription.

Quick Start

Use tsentials-http to call an endpoint and handle errors via Result<T> rather than exceptions by writing a single RequestBuilder flow that ends with .send<User>().

Frequently Asked Questions about tsentials-http

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle HTTP errors in TypeScript without try/catch blocks?

Fluent request building in TypeScript uses a RequestBuilder API to chain headers, query parameters, and JSON or raw bodies, terminating with a .send<T>() call to return typed response outcomes.

What is the best way to return typed API responses from fetch calls in TypeScript?

The best way to return typed API responses is wrapping fetch operations in a Result<T> object, ensuring both 2xx successes and 4xx/5xx failures produce predictable, strongly typed success or error flows.

How do I parse RFC 9457 ProblemDetails for HTTP error descriptions?

You parse RFC 9457 ProblemDetails by applying an error extraction function to HTTP responses, mapping status codes to AppError and extracting human-readable details for consistent TypeScript error reporting.

Does this HTTP client approach support fluent request building for REST APIs?

Yes, this HTTP client approach supports REST APIs by providing a fluent RequestBuilder to configure headers, query parameters, and bodies for get, post, put, patch, and delete scenarios before sending typed requests.

Why does my TypeScript fetch wrapper keep throwing exceptions on API failures?

TypeScript fetch wrappers throw exceptions on API failures when they lack Result<T> mapping, which is resolved by converting HTTP status codes directly into AppError types rather than relying on exception throwing.