Include reqwest in transport-streamble-http-client feature#376
Include reqwest in transport-streamble-http-client feature#3764t145 merged 4 commits intomodelcontextprotocol:mainfrom
Conversation
|
How about moving this block to The "this block" I say means the convertion from impl From<reqwest::Error> for StreamableHttpError<reqwest::Error> {
fn from(e: reqwest::Error) -> Self {
StreamableHttpError::Client(e)
}
}This will allow user to choose the client. |
- Fix compilation error when using transport-streamable-http-client feature due to missing dependency - Move From<reqwest::Error> implementation to reqwest module
Good catch, updated. |
|
I mean the latter. I have to admit that it could be confusing for user, so maybe we should add some guide, maybe in the document of |
|
@4t145 Ok, I've made the transports client-agnostic by:
As you'll see I had to fix the same issue for SSE client since it was also forcing reqwest dependencies. Let me know if this what you what you had in mind. |
|
Looks good now, just fix the ci |
- Added reqwest features for reqwest-based implementations. - Updated documentation - Modified error handling in SSE transport to use `String` for content type. - Updated examples to include new features
|
Oops sorry should pass now |
|
format check CI failed, just use |
- Added reqwest features for reqwest-based implementations - Updated documentation - Modified error handling in SSE transport to use `String` - Updated examples to include new features
|
Thanks! |
…elcontextprotocol#376) * fix: add reqwest dependency to transport-streamable-http-client feature - Fix compilation error when using transport-streamable-http-client feature due to missing dependency - Move From<reqwest::Error> implementation to reqwest module * feat(rmcp): enhance transport features by decoupling reqwest - Added reqwest features for reqwest-based implementations. - Updated documentation - Modified error handling in SSE transport to use `String` for content type. - Updated examples to include new features * feat(rmcp): enhance transport features by decoupling reqwest - Added reqwest features for reqwest-based implementations - Updated documentation - Modified error handling in SSE transport to use `String` - Updated examples to include new features
Closes #349
Motivation and Context
The
transport-streamable-http-clientfeature makes use of the reqwest crate, but does not declare it as a component feature in the rmcp Cargo.toml. This prevents a project with rmcp from being compiled if they make use of the feature.How Has This Been Tested?
I've managed to now compile my application using
transport-streamable-http-client.Breaking Changes
No
Types of changes
Checklist
Additional context