Registry / web-framework / http-api-problem

http-api-problem

JSON →
library0.60.0rscratesunverified

A library to create HTTP error response content for APIs based on RFC 7807.

# Cargo.toml [dependencies] http-api-problem = "0.60.0"
INSTALL
IMPORT
SIG · HTTP-API-PROBLEM
H
http-api-problem
web-frameworkrustv0.60.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HttpApiProblem
use http_api_problem::HttpApiProblem;

Create an RFC 7807 problem JSON for a 404 error.

use http_api_problem::HttpApiProblem; use http::StatusCode; fn main() { let problem = HttpApiProblem::new(StatusCode::NOT_FOUND) .with_title("Resource not found") .with_detail("The requested resource does not exist."); println!("Problem JSON: {}", serde_json::to_string(&problem).unwrap()); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.60.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
http-api-problem — cargo add http-api-problem · libregistry