Skip to content

Conversation

@larosi
Copy link

@larosi larosi commented Jan 19, 2026

Problem

XML History queries were sent using GET with the XML embedded in the URL.
When tag names contain special or non-ASCII characters (e.g. %, ñ), the query
becomes invalid and Aspen returns: No query has been specified.

Fix

Send XML queries using POST with the XML in the request body and
Content-Type: text/xml; charset=utf-8.

  • Its enables History reads for tags with special characters.
  • No change for dict-based GET queries.

@Asgmel
Copy link
Contributor

Asgmel commented Jan 20, 2026

Hi! Thanks for this PR!

I have a concern about backward compatibility: this change modifies the fetch function to always use POST requests when params is a string, which could break existing functionality for users who need GET requests with string parameters.

Since I'm not deeply familiar with all the Aspen implementation details, I'm unsure what edge cases this might affect. Could you refactor this to preserve the existing behavior by either:

Adding a parameter to explicitly control the HTTP method (e.g., method="POST" or use_post=True), or
Creating a separate function (e.g., fetch_with_post()) that can be called specifically when POST is required
This way, we maintain backward compatibility while still enabling the new functionality you need. What do you think?

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