Skip to content

Allow DoRequest to take a custom content type #95

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

Open
nstuart-at-salesforce opened this issue Apr 9, 2025 · 1 comment
Open

Allow DoRequest to take a custom content type #95

nstuart-at-salesforce opened this issue Apr 9, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@nstuart-at-salesforce
Copy link

nstuart-at-salesforce commented Apr 9, 2025

This library works great!

I'm looking to use this library to perform Metadata API deploys via the REST API. Ideally I'd use sf.DoRequest(...), unfortunately I need to set Content-Type to something custom like multipart/form-data; boundary=--------------------------BOUNDARY ----------------------------BOUNDARY, except it has a hardcoded content: jsonType in the requestPayload. By creating a new method DoRequestCustom() or something similar, it would allow expanding the use cases of this library.

I'm looking at contributing to the repo now, but wanted to file an issue to see if there were thoughts on the usefulness of this.

@k-capehart
Copy link
Owner

Hey @nstuart-at-salesforce , thanks for using go-salesforce!

That's a really good point. I think you're on to something with DoRequestCustom(). The more I think about it, the more I think it should have been like that from the beginning. I'll probably consider deprecating DoRequest in favor of whatever you come up with here. Ideally it lets you set both Content-Type and Accept headers.

In the meantime, having that extra method would be great. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants