a2aproject / a2aproject/a2a-dotnet

Provide a way to pass per-request HTTP headers to client methods

未关闭
#107 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
262
派生
64
平均合并
5 天 2 小时
30 天内合并 PR
31

描述

For per "session" headers, a HttpClient instance with preconfigured headers can be passed into the constructor of the A2A Client.
https://github.com/a2aproject/a2a-dotnet/blob/aa35e9d66c3448fe83cc6dc2e6b236b7b5af868b/src/A2A/Client/A2AClient.cs#L22

However, for headers that need to be sent for a single request, there currently is no solution. Per-request headers are required for Authentication headers in a multi-user client agent.

## Option 1:

Add a new optional dictionary parameter to each client method that is used to populate the HTTP request headers before calling the server.

## Option 2:

Leverage the metadata property currently defined on request payloads, and possibly use the "extensions" mechanism to define a "https://a2aextensions.com/httpfields" extension that can be processed by the client before sending the request.

贡献指南

打开贡献指南

调研方向

Examine the A2AClient constructor and methods in src/A2A/Client/A2AClient.cs to understand the current HTTP client usage. Review how request payloads handle metadata and extensions. Determine where to inject per-request headers, either via a new method parameter or through the existing metadata/extensions mechanism. Test by modifying a client method and verifying headers are sent correctly in a request.

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
api, backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
65/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。