<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AnkitSemwal007</title>
    <description>The latest articles on DEV Community by AnkitSemwal007 (@ankitsemwal007).</description>
    <link>https://dev.to/ankitsemwal007</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4072902%2F8cb3a37b-ac4f-444e-8563-5f1160ee895d.jpg</url>
      <title>DEV Community: AnkitSemwal007</title>
      <link>https://dev.to/ankitsemwal007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ankitsemwal007"/>
    <language>en</language>
    <item>
      <title>Why I Started Treating API Requests Like Code</title>
      <dc:creator>AnkitSemwal007</dc:creator>
      <pubDate>Tue, 11 Aug 2026 11:04:21 +0000</pubDate>
      <link>https://dev.to/ankitsemwal007/why-i-started-treating-api-requests-like-code-1384</link>
      <guid>https://dev.to/ankitsemwal007/why-i-started-treating-api-requests-like-code-1384</guid>
      <description>&lt;p&gt;When working on an application, most important development artifacts live in the project repository.&lt;/p&gt;

&lt;p&gt;Source code is in Git. Configuration is in Git. Database migrations are in Git.&lt;/p&gt;

&lt;p&gt;But API requests often live somewhere else.&lt;/p&gt;

&lt;p&gt;You create requests in an API client, organize them into collections, configure environments, add tests, and then that workflow stays inside a separate application.&lt;/p&gt;

&lt;p&gt;I started wondering:&lt;/p&gt;

&lt;p&gt;Why can't API requests simply be part of the project?&lt;/p&gt;

&lt;p&gt;That question led me to build API Hero, a Git-first REST/HTTP API client for VS Code.&lt;/p&gt;

&lt;p&gt;The basic idea&lt;/p&gt;

&lt;p&gt;Instead of keeping an API request only inside a separate tool, API Hero stores requests as .api files.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;my-project/&lt;br&gt;
├── src/&lt;br&gt;
└── api/&lt;br&gt;
    ├── users.api&lt;br&gt;
    ├── products.api&lt;br&gt;
    └── orders.api&lt;/p&gt;

&lt;p&gt;Now the API request is a normal project file.&lt;/p&gt;

&lt;p&gt;That means it can be:&lt;/p&gt;

&lt;p&gt;committed to Git&lt;br&gt;
reviewed in pull requests&lt;br&gt;
compared with previous versions&lt;br&gt;
shared with the team&lt;br&gt;
branched and merged&lt;br&gt;
kept alongside the code that uses the API&lt;/p&gt;

&lt;p&gt;The goal isn't just to use a different API client. It's to make API requests first-class development artifacts.&lt;/p&gt;

&lt;p&gt;More than just request files&lt;/p&gt;

&lt;p&gt;Once requests are project files, the rest of the API workflow can be built around them.&lt;/p&gt;

&lt;p&gt;API Hero supports:&lt;/p&gt;

&lt;p&gt;Request editor&lt;br&gt;
Collections and folders&lt;br&gt;
Variables and environments&lt;br&gt;
Authentication&lt;br&gt;
Assertions&lt;br&gt;
Collection Runner&lt;br&gt;
Run reports&lt;br&gt;
Request history&lt;br&gt;
Scenarios&lt;br&gt;
OpenAPI workflows&lt;/p&gt;

&lt;p&gt;Assertions are particularly useful because the same requests can be used for development and testing.&lt;/p&gt;

&lt;p&gt;For example, an API might return:&lt;/p&gt;

&lt;p&gt;HTTP 201&lt;/p&gt;

&lt;p&gt;while the test expects:&lt;/p&gt;

&lt;p&gt;HTTP 200&lt;/p&gt;

&lt;p&gt;The request itself succeeded. The assertion failed.&lt;/p&gt;

&lt;p&gt;API Hero exposes the expected and actual values so the difference is clear.&lt;/p&gt;

&lt;p&gt;Why VS Code?&lt;/p&gt;

&lt;p&gt;I wanted API work to stay close to the development workflow.&lt;/p&gt;

&lt;p&gt;If I'm working on an application and need to test an endpoint, I shouldn't necessarily have to leave my editor, open another application, find the right collection, configure the environment and run the request.&lt;/p&gt;

&lt;p&gt;With API Hero, the request is already in the workspace.&lt;/p&gt;

&lt;p&gt;The same files can be used by developers, collections and automated workflows.&lt;/p&gt;

&lt;p&gt;Then AI agents changed the idea&lt;/p&gt;

&lt;p&gt;The .api approach became even more interesting with AI coding agents.&lt;/p&gt;

&lt;p&gt;An AI agent can already read files in a repository.&lt;/p&gt;

&lt;p&gt;But reading an API request is different from actually executing it.&lt;/p&gt;

&lt;p&gt;So API Hero now includes a standalone MCP server that allows compatible AI agents to interact with the API workflow.&lt;/p&gt;

&lt;p&gt;An agent can:&lt;/p&gt;

&lt;p&gt;Discover collections&lt;br&gt;
Inspect requests&lt;br&gt;
Run requests&lt;br&gt;
Run collections&lt;br&gt;
Retrieve responses&lt;br&gt;
Inspect execution results&lt;br&gt;
Diagnose assertion failures&lt;/p&gt;

&lt;p&gt;The important part is that MCP doesn't implement another HTTP client.&lt;/p&gt;

&lt;p&gt;It uses the same API Hero execution pipeline:&lt;/p&gt;

&lt;p&gt;AI Agent&lt;br&gt;
   ↓&lt;br&gt;
API Hero MCP&lt;br&gt;
   ↓&lt;br&gt;
Collection Runner&lt;br&gt;
   ↓&lt;br&gt;
Execution Engine&lt;br&gt;
   ↓&lt;br&gt;
API&lt;br&gt;
   ↓&lt;br&gt;
Response&lt;br&gt;
   ↓&lt;br&gt;
Structured result&lt;/p&gt;

&lt;p&gt;This means the API execution logic doesn't have to be duplicated for AI agents.&lt;/p&gt;

&lt;p&gt;A simple example&lt;/p&gt;

&lt;p&gt;Suppose an AI agent runs a request and receives:&lt;/p&gt;

&lt;p&gt;HTTP 201&lt;/p&gt;

&lt;p&gt;But the test expects:&lt;/p&gt;

&lt;p&gt;HTTP 200&lt;/p&gt;

&lt;p&gt;Instead of simply reporting that the API request failed, API Hero can provide:&lt;/p&gt;

&lt;p&gt;HTTP request: successful&lt;br&gt;
HTTP status: 201&lt;/p&gt;

&lt;p&gt;Failure category: assertion&lt;br&gt;
Expected: 200&lt;br&gt;
Actual: 201&lt;/p&gt;

&lt;p&gt;The agent can then understand that the API responded successfully and that the test expectation is what needs attention.&lt;/p&gt;

&lt;p&gt;That's the part of the project I'm particularly interested in exploring.&lt;/p&gt;

&lt;p&gt;The bigger idea&lt;/p&gt;

&lt;p&gt;The direction I'm experimenting with is:&lt;/p&gt;

&lt;p&gt;API request&lt;br&gt;
     ↓&lt;br&gt;
Project file&lt;br&gt;
     ↓&lt;br&gt;
Git&lt;br&gt;
     ↓&lt;br&gt;
Developer / Tests / AI Agent&lt;br&gt;
     ↓&lt;br&gt;
Same API execution engine&lt;/p&gt;

&lt;p&gt;The request becomes a shared artifact.&lt;/p&gt;

&lt;p&gt;A developer can edit it.&lt;/p&gt;

&lt;p&gt;Git can track it.&lt;/p&gt;

&lt;p&gt;A collection can execute it.&lt;/p&gt;

&lt;p&gt;Tests can validate it.&lt;/p&gt;

&lt;p&gt;An AI agent can use it.&lt;/p&gt;

&lt;p&gt;What API Hero is today&lt;/p&gt;

&lt;p&gt;The current release, 2.8.2, includes:&lt;/p&gt;

&lt;p&gt;Git-first .api request files&lt;br&gt;
Request editor&lt;br&gt;
Collections&lt;br&gt;
Variables and environments&lt;br&gt;
Authentication&lt;br&gt;
Assertions&lt;br&gt;
Collection Runner&lt;br&gt;
Run reports&lt;br&gt;
Request history&lt;br&gt;
Scenarios&lt;br&gt;
OpenAPI&lt;br&gt;
Standalone MCP server&lt;br&gt;
AI-agent API execution&lt;br&gt;
Failure diagnostics&lt;br&gt;
Secret redaction&lt;/p&gt;

&lt;p&gt;API Hero is available as a VS Code extension.&lt;/p&gt;

&lt;p&gt;GitHub:&lt;br&gt;
&lt;a href="https://github.com/ankitsemwal007/api-hero" rel="noopener noreferrer"&gt;https://github.com/ankitsemwal007/api-hero&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;VS Code Marketplace:&lt;br&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=AnkitSemwal.api-hero" rel="noopener noreferrer"&gt;https://marketplace.visualstudio.com/items?itemName=AnkitSemwal.api-hero&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm interested in the underlying idea more than the product itself:&lt;/p&gt;

&lt;p&gt;Would you find it useful if API requests were first-class files in your Git repository, alongside the application code?&lt;/p&gt;

&lt;p&gt;Or do you think API requests are better kept inside a dedicated API client?&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>opensource</category>
      <category>automation</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
