-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Always having to include "/yambas/rest" in base URLs is annoying and should be handled automatically.
Implementation proposal:
When the aoms.DefaultClient is instantiated or sends its first request, it should do the following:
- Check if the baseUrl parameter/field (depending on if this gets implemented for instantiation or first request) contains "/yambas/rest".
- If it does: Keep it that way.
- If it doesn't: Add it, because in most cases it's necessary (or maybe currently even mandatory, depending on URL rewrites in ApiOmat and SDK implementations).
- Probe if the (possibly changed) baseUrl is correct by calling
GetVersion()and expecting a version string in the response body. A short timeout should be used and errors should be ignored.- If it didn't work, and "/yambas/rest" was previously added manually: Probe again with the original passed baseUrl.
- If this worked: Use the original baseUrl as base URL.
- If this didn't work: Ignore, because the probe requests were unsolicited and the caller needs to find out about the error on his own when making the first request.
- If it worked: Use the (possibly changed) baseUrl as base URL.
- If it didn't work, and "/yambas/rest" was previously added manually: Probe again with the original passed baseUrl.
Also necessary:
- Add tests to
aoms - Change doc comments and README accordingly
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request