Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Automatic transition from GET to POST not working, when "nextpage" exceede character limit #66

Open
TheMonzel opened this issue Apr 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@TheMonzel
Copy link
Contributor

TheMonzel commented Apr 19, 2024

Describe the bug
When a "nextpage" URI exceeds the APIs string limitation for GET request, the API responds with a 404 error and throws an error.

To Reproduce
Steps to reproduce the behavior:

  1. Use Get-AutotaskAPIResource (-Method GET) with a potentially long query
  2. Ensure that a nextpage are loaded
  3. Currently, string length is only validated on the initial call; not for every next-page
  4. The API throws an 404 error message

Expected behavior

  • The module should throw a valid error message.
  • The module should use POST instead of GET-method

Current Workaround
Adding 100 characters to the initial string length. Not the optimal option, but at least a start.
See:

#100 characters for Call of next page (Including "paging={"pageSize":500,"previousIds":[<ID>],"nextIds":[<ID>]}&" UTF-8 encoded)
and 7540459

Additional context
Possible solution/enhancements:

  • Make POST default (in this case only forced Get-queries could run into this issue)
  • Use POST request instead of GET; this detection is made before the do .. while loop. "Nextpage" string can only be validated inside this loop. Therefor the logic must be called from inside the loop.
@TheMonzel TheMonzel added the bug Something isn't working label Apr 19, 2024
@TheMonzel
Copy link
Contributor Author

@KelvinTegelaar Follow up for #65
I can post a commit switch the default call from GET to POST. I guess, this will do the job for all existing use cases. This issue would only persist, when Get-AutotaskAPIResource -Method GET is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant