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

Specifying custom headers on SLConnection #74

Open
EricWu91 opened this issue May 28, 2024 · 4 comments
Open

Specifying custom headers on SLConnection #74

EricWu91 opened this issue May 28, 2024 · 4 comments

Comments

@EricWu91
Copy link
Contributor

Sorry for the barrage of questions :)

As specified here (https://community.sap.com/t5/enterprise-resource-planning-q-a/service-layer-how-to-remove-all-addresses-of-a-business-partner/qaq-p/578058), whenever I want to clear the collections of a PATCH request (e.g. Business Partners' addresses), I'm required to provide a specific header: B1S-ReplaceCollectionsOnPatch=true

Is there a way to do that in SLConnection?

@bgmulinari
Copy link
Owner

bgmulinari commented May 28, 2024

Hi, @EricWu91.

Yes, you can call WithReplaceCollectionsOnPatch extension method in your request to add this header.

await serviceLayer
    .Request("BusinessPartners", "C00001")
    .WithReplaceCollectionsOnPatch()
    .PatchAsync(yourObject);

@EricWu91
Copy link
Contributor Author

Sweet!
Sorry if it was obvious. Did I miss a doc pointing that out?

@bgmulinari
Copy link
Owner

Not really, I'm yet to write a proper documentation for B1SLayer. I'll start that once 2.0 is out :)

@EricWu91
Copy link
Contributor Author

Ok! If you need, I can help you with that.
Just create an issue and mention me and I'll do what I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants