Skip to content

MongoDB Atlas Administration API V2 - Support for Headers #58

@seaver-choy

Description

@seaver-choy

First of all, thank you for creating this project.

Since MongoDB Atlas Administration API is moving towards v2, we need to be able to add header with
{ "Accept": "application/vnd.atlas.2025-03-12+json" }
or else, we will always get denied from MongoDB Atlas API with 406.

We can simply add header support for the httpClient so that a user can just include it in their getClient construction. They can change the baseUrl to "https://cloud.mongodb.com/api/atlas/v2", and then add the header like so:

const {user, cluster} = getClient({
  "publicKey": "some public key",
  "privateKey": "some private key",
  "baseUrl": "https://cloud.mongodb.com/api/atlas/v2",
  "projectId": "some project/group id",
  "header": {"Accept": "application/vnd.atlas.2025-03-12+json"}
});

I've made this work on my own project already. Let me know if I can contribute as well.

Thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions