Generate MDX for HttpRequest components. Use when creating API request documentation in Doclific that allows users to make live HTTP requests.
This skill helps you generate the MDX for HttpRequest components in Doclific documentation. These components allow users to make live HTTP requests directly from the documentation.
When the user asks you to create an HTTP request component:
Gather requirements: Ask the user about:
Create input JSON: Write a JSON file with the request configuration.
Run the generator script: Execute the script to generate the MDX component.
Insert the MDX: Copy the output into the documentation.
Never try to manually edit the HTML-encoded JSON attributes in an existing <HttpRequest> component.
The attributes contain HTML-encoded JSON (e.g., " for quotes) which is difficult to edit correctly by hand.
When a user asks to update an existing HTTP request:
<HttpRequest>...</HttpRequest> block with the new outputThis ensures the HTML encoding is always correct and avoids encoding errors.
Always include the protocol (http:// or https://) in the URL.
https://api.example.com/usershttp://localhost:3000/api/healthapi.example.com/userslocalhost:3000/api/healthThe HttpRequest component makes real HTTP requests from the browser, so the full URL with protocol is required.
Create a JSON file with the following structure:
{
"method": "POST",
"url": "https://api.example.com/users",
"headers": [
{ "key": "Content-Type", "value": "application/json", "enabled": true },
{ "key": "Accept", "value": "application/json", "enabled": true }
],
"queryParams": [
{ "key": "version", "value": "2", "enabled": true }
],
"bodyType": "json",
"bodyContent": "{\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\"\n}",
"formData": [],
"auth": {
"type": "bearer",
"token": "your-api-token"
}
}
HTTP method. One of: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
The full request URL including protocol (http:// or https://). Examples:
https://api.example.com/v1/usershttp://localhost:8080/api/healthArray of header objects:
{ "key": "Header-Name", "value": "header-value", "enabled": true }
key: Header namevalue: Header valueenabled: Whether the header is active (default: true)Array of query parameter objects (same structure as headers):
{ "key": "param", "value": "value", "enabled": true }
Request body type. One of:
none - No body (default)json - JSON bodyraw - Raw text bodyform-data - Multipart form datax-www-form-urlencoded - URL-encoded formThe body content as a string. Used when bodyType is json or raw.
For JSON bodies, use escaped newlines for formatting:
"bodyContent": "{\n \"key\": \"value\"\n}"
Array of form field objects (same structure as headers). Used when bodyType is form-data or x-www-form-urlencoded:
{ "key": "field", "value": "value", "enabled": true }
Authentication configuration. Structure depends on type:
No Auth (default):
{ "type": "none" }
Basic Auth:
{
"type": "basic",
"username": "user",
"password": "pass"
}
Bearer Token:
{
"type": "bearer",
"token": "your-token"
}
API Key:
{
"type": "apikey",
"apiKeyName": "X-API-Key",
"apiKeyValue": "your-api-key",
"apiKeyLocation": "header"
}
apiKeyLocation: Either header or querynode skills/generate-doclific-http-request/generate-request.js <json-file-path>
<HttpRequest> MDX componentInput JSON:
{
"method": "GET",
"url": "https://api.example.com/users"
}
Input JSON:
{
"method": "POST",
"url": "https://api.example.com/users",
"headers": [
{ "key": "Content-Type", "value": "application/json", "enabled": true }
],
"bodyType": "json",
"bodyContent": "{\n \"name\": \"John\",\n \"email\": \"john@example.com\"\n}"
}
Input JSON:
{
"method": "GET",
"url": "https://api.example.com/me",
"auth": {
"type": "bearer",
"token": "eyJhbGciOiJIUzI1NiIs..."
}
}
Input JSON:
{
"method": "POST",
"url": "https://api.example.com/upload",
"bodyType": "form-data",
"formData": [
{ "key": "name", "value": "document.pdf", "enabled": true },
{ "key": "description", "value": "My document", "enabled": true }
]
}
See example.json for a complete example.
npx skills add muellerluke/generate-doclific-http-request下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer