[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KMCMXCAK6SM4K5H6WH8F2T":3,"skill-same:01M6KMCMXCAK6SM4K5H6WH8F2T":62},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":13,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M6KMCMXCAK6SM4K5H6WH8F2T","http-request",null,"ahvcxa\u002Fagents-runtime","ahvcxa","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F66177097?v=4","01M6KMC1M42AY53F851R4PYQ86","BATUHAN INAN","01M6KMC1QYQESNZDK2PP0J9FJG",0,"MIT","https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftemplate\u002F.agents\u002Fhttp-request\u002FSKILL.md",[],[18,19,20],"http","http request","request","2026-11-10 10:12:30",false,"# HTTP Request Skill\n\nMake secure HTTP\u002FHTTPS API calls with professional-grade features: automatic retries, timeout protection, response streaming, and credential masking.\n\n## Quick Start\n\n```javascript\nconst { execute } = require('.\u002F.agents\u002Fskills\u002Fhttp-request\u002Fhandler');\n\n\u002F\u002F Simple GET request\nconst result = await execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fapi.github.com\u002Fusers\u002Fgithub'\n});\n\nif (result.success) {\n  console.log('Status:', result.data.status);\n  console.log('Body:', result.data.body);\n} else {\n  console.error('Error:', result.error.code, result.error.message);\n}\n```\n\n## Features\n\n### ✅ Built-in Security\n- **SSL\u002FTLS Verification**: Always enabled. Prevents MITM attacks.\n- **Credential Masking**: Auth headers are redacted from logs automatically.\n- **Size Limits**: Prevents memory exhaustion (5MB request, 50MB response).\n- **Timeout Protection**: Requests hang protection (default 30s).\n\n### ✅ Reliability\n- **Automatic Retries**: Exponential backoff for transient failures.\n- **Redirect Following**: Smart handling of 3xx redirects (max 5).\n- **Error Recovery**: Distinguishes between retryable and permanent errors.\n- **Compression Support**: Handles gzip and deflate responses.\n\n### ✅ Observability\n- **Structured Logging**: Execution time, retry count, redirect count.\n- **Detailed Errors**: Clear error codes (TIMEOUT, SSL_ERROR, etc.)\n- **Response Metadata**: Size, headers, status codes.\n\n## Parameters\n\n| Parameter | Type | Default | Required | Description |\n|-----------|------|---------|----------|-------------|\n| **method** | string | - | ✅ | HTTP method: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS |\n| **url** | string | - | ✅ | Target URL (http or https). Max 2048 chars. |\n| **headers** | object | {} | - | Custom HTTP headers |\n| **body** | string\\|object | null | - | Request body (auto JSON stringified). Max 5MB. |\n| **timeout** | number | 30000 | - | Timeout in milliseconds (100ms - 5min) |\n| **retry** | object | - | - | Retry configuration (see below) |\n| **allowRedirects** | boolean | true | - | Follow 3xx redirects (max 5) |\n| **validateStatus** | boolean | true | - | Treat 4xx\u002F5xx as errors |\n\n### Retry Configuration\n\n```javascript\nretry: {\n  maxAttempts: 3,           \u002F\u002F 1-10 attempts\n  initialDelay: 1000,       \u002F\u002F Initial delay in ms (min 100)\n  backoffMultiplier: 2      \u002F\u002F Exponential backoff (1-10)\n}\n```\n\n**Exponential Backoff Example** (initialDelay=1000, multiplier=2):\n- Attempt 1: Fail → Wait 1000ms\n- Attempt 2: Fail → Wait 2000ms\n- Attempt 3: Fail → Wait 4000ms\n- Attempt 4: Give up\n\n## Response Format\n\n### Success Response\n\n```javascript\n{\n  success: true,\n  data: {\n    status: 200,\n    statusText: \"OK\",\n    headers: {\n      \"content-type\": \"application\u002Fjson\",\n      \"content-length\": \"1234\"\n    },\n    body: { \u002F* parsed response *\u002F },\n    size: 1234\n  },\n  error: null,\n  metadata: {\n    executionTime: 234,      \u002F\u002F milliseconds\n    timestamp: \"2026-04-07T...\",\n    retries: 0,\n    redirects: 0\n  }\n}\n```\n\n### Error Response\n\n```javascript\n{\n  success: false,\n  data: null,\n  error: {\n    code: \"NETWORK_TIMEOUT\",     \u002F\u002F Error code\n    message: \"Request timed out after 30000ms\",\n    details: {\n      errorCode: \"ETIMEDOUT\",    \u002F\u002F Node.js error code\n      nodeError: \"...\"\n    }\n  },\n  metadata: {\n    executionTime: 30123,\n    timestamp: \"2026-04-07T...\"\n  }\n}\n```\n\n## Error Codes\n\n| Code | Cause | Retryable | Notes |\n|------|-------|-----------|-------|\n| **INVALID_URL** | Malformed URL | No | Check URL format |\n| **NETWORK_TIMEOUT** | Request exceeded timeout | Yes | Increase timeout if needed |\n| **NETWORK_ERROR** | Connection failed | Yes | Check network\u002FDNS |\n| **SSL_ERROR** | Certificate verification failed | No | Check certificate or update CA |\n| **HTTP_ERROR** | 4xx\u002F5xx status code | Maybe | 5xx errors may retry |\n| **RESPONSE_TOO_LARGE** | Response > 50MB | No | Reduce response size |\n| **INVALID_JSON** | JSON parsing failed | No | Check response format |\n| **REDIRECT_LIMIT_EXCEEDED** | Too many redirects | No | Use allowRedirects=false |\n| **UNSUPPORTED_PROTOCOL** | Not http\u002Fhttps | No | Use http:\u002F\u002F or https:\u002F\u002F |\n\n## Examples\n\n### 1. Simple GET\n\n```javascript\nconst result = await execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fusers'\n});\n\nconsole.log(result.data.body); \u002F\u002F Array of users\n```\n\n### 2. POST with JSON Body\n\n```javascript\nconst result = await execute({\n  method: 'POST',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fusers',\n  headers: {\n    'Content-Type': 'application\u002Fjson'\n  },\n  body: {\n    name: 'John',\n    email: 'john@example.com'\n  }\n});\n\nconsole.log(result.data.body.id); \u002F\u002F New user ID\n```\n\n### 3. With Authentication\n\n```javascript\nconst result = await execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fapi.github.com\u002Fuser',\n  headers: {\n    'Authorization': 'Bearer your-github-token',\n    'Accept': 'application\u002Fvnd.github.v3+json'\n  }\n});\n\n\u002F\u002F Auth header is masked in logs: Authorization: ***MASKED***\nconsole.log(result.data.body.login); \u002F\u002F GitHub username\n```\n\n### 4. Custom Retry Strategy\n\n```javascript\nconst result = await execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fflaky-api.example.com\u002Fdata',\n  timeout: 10000,\n  retry: {\n    maxAttempts: 5,          \u002F\u002F Try up to 5 times\n    initialDelay: 500,       \u002F\u002F Start with 500ms delay\n    backoffMultiplier: 1.5   \u002F\u002F 500ms → 750ms → 1.1s → 1.7s → 2.5s\n  }\n});\n\nconsole.log(result.metadata.retries); \u002F\u002F Number of retries performed\n```\n\n### 5. No Retries (Fail Fast)\n\n```javascript\nconst result = await execute({\n  method: 'POST',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fcritical-operation',\n  body: { action: 'delete' },\n  retry: {\n    maxAttempts: 1  \u002F\u002F No retries\n  }\n});\n```\n\n### 6. Disable Redirect Following\n\n```javascript\nconst result = await execute({\n  method: 'HEAD',\n  url: 'https:\u002F\u002Fexample.com\u002Fold-page',\n  allowRedirects: false\n});\n\n\u002F\u002F Get redirected location without following\nif (result.data.status === 301) {\n  const newLocation = result.data.headers.location;\n}\n```\n\n### 7. Ignore 4xx Errors\n\n```javascript\nconst result = await execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fmaybe-not-found',\n  validateStatus: false  \u002F\u002F Don't treat 404 as error\n});\n\nif (result.data.status === 404) {\n  console.log('Not found'); \u002F\u002F success=true, but status=404\n}\n```\n\n### 8. Large Response Handling\n\n```javascript\nconst result = await execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fhuge-dataset',\n  timeout: 60000  \u002F\u002F Increase timeout for large responses\n});\n\nconsole.log(result.metadata.executionTime); \u002F\u002F Time spent\nconsole.log(result.data.size);               \u002F\u002F Response size in bytes\n```\n\n## Security Best Practices\n\n### 1. Always Use HTTPS\n\n```javascript\n\u002F\u002F Good\nawait execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fdata'\n});\n\n\u002F\u002F Bad - Unencrypted\nawait execute({\n  method: 'GET',\n  url: 'http:\u002F\u002Fapi.example.com\u002Fdata'\n});\n```\n\n### 2. Don't Log Raw Responses with Credentials\n\n```javascript\n\u002F\u002F Good - Log only what you need\nconsole.log('Status:', result.data.status);\n\n\u002F\u002F Bad - Could expose tokens\u002Fpasswords\nconsole.log('Full response:', JSON.stringify(result.data.body));\n```\n\n### 3. Validate URLs from User Input\n\n```javascript\n\u002F\u002F Good - Validate before use\nfunction isAllowedUrl(url) {\n  const allowedDomains = ['api.example.com', 'cdn.example.com'];\n  const urlObj = new URL(url);\n  return allowedDomains.includes(urlObj.hostname);\n}\n\nif (isAllowedUrl(userProvidedUrl)) {\n  await execute({ method: 'GET', url: userProvidedUrl });\n}\n\n\u002F\u002F Bad - Use user URL directly\nawait execute({ method: 'GET', url: userUrl });\n```\n\n### 4. Handle Errors Safely\n\n```javascript\n\u002F\u002F Good - Log context, not secrets\nif (!result.success) {\n  console.error('API call failed:', {\n    code: result.error.code,\n    url: result.data?.headers?.url,\n    status: result.data?.status\n  });\n}\n\n\u002F\u002F Bad - Could expose sensitive info\nconsole.error('Request failed:', result);\n```\n\n### 5. Set Appropriate Timeouts\n\n```javascript\n\u002F\u002F Good - Reasonable timeouts for different operations\nconst shortOp = await execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fhealth',\n  timeout: 5000  \u002F\u002F 5s for health checks\n});\n\nconst longOp = await execute({\n  method: 'POST',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fprocess',\n  timeout: 120000  \u002F\u002F 2min for processing\n});\n\n\u002F\u002F Bad - No timeout (could hang forever)\nawait execute({\n  method: 'GET',\n  url: 'https:\u002F\u002Fapi.example.com\u002Fdata'\n  \u002F\u002F No timeout specified\n});\n```\n\n## Comparison with Other Tools\n\n| Feature | http-request | curl | fetch API |\n|---------|--------|------|-----------|\n| Automatic retries | ✅ | ❌ | ❌ |\n| Credential masking | ✅ | ❌ | ❌ |\n| Timeout protection | ✅ | ⚠️ | ⚠️ |\n| Response size limit | ✅ | ❌ | ❌ |\n| Exponential backoff | ✅ | ❌ | ❌ |\n| Structured errors | ✅ | ⚠️ | ⚠️ |\n\n## Troubleshooting\n\n### \"NETWORK_TIMEOUT\" Error\n\n**Cause**: Request took longer than timeout period\n\n**Solutions**:\n1. Increase timeout: `timeout: 60000` (60s)\n2. Check server health\n3. Reduce retry count: `maxAttempts: 1`\n\n### \"SSL_ERROR\"\n\n**Cause**: Certificate verification failed\n\n**Solutions**:\n1. Ensure server has valid SSL certificate\n2. Check system time is correct\n3. Update CA certificates\n4. For development only: Set NODE_TLS_REJECT_UNAUTHORIZED=0\n\n### \"ENOTFOUND\" Network Error\n\n**Cause**: DNS lookup failed\n\n**Solutions**:\n1. Check DNS is working: `nslookup api.example.com`\n2. Verify URL is correct\n3. Check network connectivity\n\n### All Retries Exhausted\n\n**Cause**: Server is down or returning 5xx errors\n\n**Solutions**:\n1. Check server status\n2. Wait and retry manually\n3. Reduce retry count: `maxAttempts: 2`\n4. Increase delay: `initialDelay: 5000`\n\n## Performance Tips\n\n1. **Reuse connections**: HTTP keep-alive is automatic\n2. **Reduce payload size**: Use gzip compression if server supports\n3. **Parallel requests**: Use Promise.all() for multiple requests\n4. **Cache responses**: Implement caching layer if data is stable\n5. **Monitor execution time**: Check metadata.executionTime for slow requests\n\n## Related Skills\n\n- **data-transform**: Parse and transform JSON responses\n- **logging**: Log HTTP interactions\n- **file-operations**: Save HTTP responses to disk\n\n---\n\n**Version**: 1.0.0  \n**Last Updated**: 2026-04-07\n",{},"main","f660bfb38f1f58be7aa35b3e67f77b2add4b048a","template\u002F.agents\u002Fhttp-request","https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime","https:\u002F\u002Fgithub.com\u002Fahvcxa","🍀 Data Scientist 🍀","2026-04-13 01:43:13",{"source":7,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add ahvcxa\u002Fagents-runtime --skill http-request",{"tool":38,"command":39},"bunx","bunx skills add ahvcxa\u002Fagents-runtime --skill http-request",{"tool":41,"command":42},"pnpm","pnpm dlx skills add ahvcxa\u002Fagents-runtime --skill http-request","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftemplate\u002F.agents\u002Fhttp-request\u002FSKILL.md",true,[46,52,56],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"__tests__\u002Fhandler.test.js","SCRIPT","脚本",1463,"https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftemplate\u002F.agents\u002Fhttp-request\u002F__tests__\u002Fhandler.test.js",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"handler.js",10125,"https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftemplate\u002F.agents\u002Fhttp-request\u002Fhandler.js",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"manifest.json","REFERENCE","参考文档",7594,"https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftemplate\u002F.agents\u002Fhttp-request\u002Fmanifest.json",[63,74,87,100,112,119],{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":21},"01M6KMDCFV4G3TY0VCFA65NVA4","security-audit","https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fproject\u002F.agents\u002Fskills\u002Fsecurity-audit\u002FSKILL.md",[],[69,70,71,72,65,73],"security","audit","security audit","analysis","true",{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":84,"publishedAt":21},"01M6KMD96V3XP64WZR6MJQQZ8M","refactor","https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fproject\u002F.agents\u002Fskills\u002Frefactor\u002FSKILL.md",[79],{"categoryNo":80,"categoryName":81,"taxonomyType":82,"taxonomyTypeDesc":83},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",[76,85,86],"false","transformation",{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":97,"publishedAt":21},"01M6KMD7A4W1DAJPQBAHVXCNBR","code-analysis","https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fproject\u002F.agents\u002Fskills\u002Fcode-analysis\u002FSKILL.md",[92],{"categoryNo":93,"categoryName":94,"taxonomyType":95,"taxonomyTypeDesc":96},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[72,98,99,73,89],"code","code analysis",{"skillNo":101,"name":102,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":108,"publishedAt":21},"01M6KMD5AF1W8X1EFVZB0HS0JP","test-generator","https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftemplate\u002F.agents\u002Ftest-generator\u002FSKILL.md",[105],{"categoryNo":106,"categoryName":107,"taxonomyType":82,"taxonomyTypeDesc":83},"01JBSEEDCAT000000000000008","测试与质量",[109,110,111],"generator","test generator","test",{"skillNo":113,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":21},"01M6KMD1Q19ES77DCKNZXCRTQA","https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftemplate\u002F.agents\u002Fsecurity-audit\u002FSKILL.md",[],[71,70,69,117,73,118,65,72],"handler","js",{"skillNo":120,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":124,"publishedAt":21},"01M6KMCYTX2FXC810HE6RXTYTH","https:\u002F\u002Fgithub.com\u002Fahvcxa\u002Fagents-runtime\u002Fblob\u002Fmain\u002Ftemplate\u002F.agents\u002Frefactor\u002FSKILL.md",[123],{"categoryNo":80,"categoryName":81,"taxonomyType":82,"taxonomyTypeDesc":83},[76,117,85,86,125,118,126],"patch","refactoring"]