Skip to content

BatchRequestBuilder url template includes extra forward slash #834

Closed

Description

@GeorgeOG

Describe the bug

Whenever batch requests are made, I receive the following:

        APIError
        Code: 400
        message: The server returned an unexpected status code and no error class is registered for this code 400

Expected behavior

no error recieved

How to reproduce

make batch request

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

setting base url manually:

client.request_adapter.base_url = "https://graph.microsoft.com/v1.0"

Debug output

Click to expand log
<Log output here>

Configuration

No response

Other information

I believe the issue stems from the BatchRequestBuilder init, which sets
self.url_template = f"{self._request_adapter.base_url}/$batch"
but the base url includes a trailing slash already.

Activity

  1. added
    status:waiting-for-triage
    type:bug
    on Feb 22, 2025
  2. andrueastman commented on Feb 24, 2025

    @andrueastman
    Contributor

    Thanks for raising this GeorgeOG

    Any chance you're willing to submit a PR to address this by following the contribution guideline below? https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/main/CONTRIBUTING.md

  3. added
    status:waiting-for-author-feedback
    and removed
    status:waiting-for-triage
    on Feb 24, 2025
  4. GeorgeOG commented on Feb 24, 2025

    @GeorgeOG
    ContributorAuthor

    Happily Andrew Omondi (@andrueastman) - could you give me permission to push to origin, doesn't look like I can atm.

  5. added and removed
    status:waiting-for-author-feedback
    on Feb 24, 2025
  6. andrueastman commented on Feb 24, 2025

    @andrueastman
    Contributor
  7. added
    status:waiting-for-author-feedback
    and removed on Feb 24, 2025
  8. GeorgeOG commented on Feb 24, 2025

    @GeorgeOG
    ContributorAuthor

    Andrew Omondi (@andrueastman) Have opened a PR against this issue and one other: #837

  9. added and removed
    status:waiting-for-author-feedback
    on Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

WIPtype:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions