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

Adding MERGE HTTP method #400

Open
iamNoah1 opened this issue Aug 27, 2020 · 6 comments
Open

Adding MERGE HTTP method #400

iamNoah1 opened this issue Aug 27, 2020 · 6 comments

Comments

@iamNoah1
Copy link

iamNoah1 commented Aug 27, 2020

Is your feature request related to a problem? Please describe.
Working on a project that uses ms-rest-js and need to handle HTTP MERGE request method

Describe the solution you'd like
Add MERGE as possible request method

@xirzec
Copy link
Member

xirzec commented Sep 22, 2020

Looks like this needs to get added to

export type HttpMethods = "GET" | "PUT" | "POST" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS" | "TRACE";

Can you add some context about which service is using this?

@iamNoah1
Copy link
Author

I needed that for Azurite table, but in the meanwhile the other contributers added a solution for solving my blocker (https://github.com/Azure/Azurite/pull/545/files). But TBH I cannot say if that is only a workaround. Anyways I think adding MERGE method is relevant anyways.

@xirzec
Copy link
Member

xirzec commented Sep 28, 2020

Looking at this again, it seems like MERGE is not a standard request method: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods

And this page makes it sound like PATCH is preferred: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-odata/59d5abd3-7b12-490a-a0e2-9d9324b91893

Since MERGE is not one of the verbs that is defined in the HTTP specification [RFC2616], using the MERGE verb might not flow through network intermediaries as seamlessly as methods that are defined in the HTTP specification. The HTTP PATCH verb is preferred over HTTP MERGE when working with data services that support the OData 3.0 protocol.

I'm a little confused why storage-tables would require the use of a non-standard request method.

@iamNoah1
Copy link
Author

Interesting point. Even though MERGE seems not be a standard request method, the storage api specifies MERGE as method for the merge entity operation: https://docs.microsoft.com/en-us/rest/api/storageservices/merge-entity. I think PATCH is also valid, but Azurite wants to be API spec compliant to the storage API spec.

@xirzec
Copy link
Member

xirzec commented Sep 29, 2020

Technically I think you could set the method with "MERGE" as any and it would work, if you just want TS not to complain.

@jeremymeng
Copy link
Member

@iamNoah1 would the workaround of "MERGE" as any work for you?

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

No branches or pull requests

3 participants