import { parseContentType } from "https://deno.land/x/ayonli_jsext@v0.9.72/workerd/http.ts";
Parses the Content-Type
header.
Examples
Example 1
Example 1
import { parseContentType } from "@ayonli/jsext/http";
const type = parseContentType("text/html; charset=utf-8");
console.log(type);
// { type: "text/html", charset: "utf-8" }
const type2 = parseContentType("multipart/form-data; boundary=----WebKitFormBoundaryzjK4sVZ2QeZvz5zB");
console.log(type2);
// { type: "multipart/form-data", boundary: "----WebKitFormBoundaryzjK4sVZ2QeZvz5zB" }