Skip to content

Conversation

@Codelisk
Copy link
Contributor

Summary

  • Added handling for plain string responses in BaseHttpRequestHandler.Send<TResult> method that don't require JSON deserialization
  • When TResult is of type string, the response content is now read directly as a string instead of attempting JSON deserialization

Changes

This PR adds an additional condition in the Send<TResult> method to check if typeof(TResult) == typeof(string) before falling back to JSON deserialization. This prevents deserialization errors when the API endpoint returns plain text responses.

The change follows the existing pattern for handling HttpResponseMessage responses and maintains the same coding style.

Test plan

  • Test with endpoints that return plain text/string responses
  • Verify that JSON responses still work correctly
  • Verify that HttpResponseMessage handling still works correctly

🤖 Generated with Claude Code

Added handling for plain string responses that don't require JSON deserialization. When TResult is of type string, the response content is now read directly as a string instead of attempting JSON deserialization, which would fail for plain text responses.

This change adds an additional condition in the Send<TResult> method to check if typeof(TResult) == typeof(string) before falling back to JSON deserialization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Codelisk
Copy link
Contributor Author

@aritchie if thats the wrong approach you can close this pr I just needed it in my handler for some responses in the project

@Codelisk Codelisk closed this Nov 26, 2025
@Codelisk Codelisk reopened this Nov 26, 2025
@aritchie
Copy link
Member

@Codelisk not sure yet. This PR will likely go through, but still considering things around the serialization service. Technically, you can implement your own ISerializerService in the meantime to deal with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants