question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP Request - Support other custom HTTP methods - MERGE

See original GitHub issue

I’m submitting a …

[x] feature request

Current behavior Unable to use HTTP MERGE method/verb. throws new Error(‘Invalid request method. The method “${method}” is not supported.’);

According to:

  if (typeof method !== 'string') return method;

  switch (method.toUpperCase()) {
    case 'GET':
      return RequestMethod.Get;
    case 'POST':
      return RequestMethod.Post;
    case 'PUT':
      return RequestMethod.Put;
    case 'DELETE':
      return RequestMethod.Delete;
    case 'OPTIONS':
      return RequestMethod.Options;
    case 'HEAD':
      return RequestMethod.Head;
    case 'PATCH':
      return RequestMethod.Patch;
  }
  throw new Error(`Invalid request method. The method "${method}" is not supported.`);
}

https://github.com/angular/angular/blob/4.0.0/packages/http/src/http_utils.ts

Expected behavior Either:

  1. Support HTTP MERGE method/verb in enum
  2. Don’t block (throw error) if a ‘custom’ method not pre-defined is used.

What is the motivation / use case for changing the behavior? Whilst the library HTTP methods are compliant with the RFC https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html:

Not all established REST API’s on the web fully conform. For example, Microsoft Azure Table Storage (a NoSQL database) which uses MERGE.https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/merge-entity

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
alxhubcommented, Apr 18, 2017

Hello @murraybauer,

This is currently planned for upcoming HTTP APIs.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 12, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP POST and MERGE (update) - Progress Documentation
Update an entity using the custom X-HTTP-Method header with a value of MERGE . The body of the request should contain an entity...
Read more >
Custom HTTP Methods == More Flexibility and Autonomy
Custom HTTP Methods == More Flexibility and Autonomy · Click the method dropdown menu, you'll see the method name highlighted · Start typing...
Read more >
[MS-ODATA]: PATCH/MERGE | Microsoft Learn
Data services support two types of update operations: merge and replace ... The remainder of this section defines a custom HTTP MERGE method...
Read more >
HTTP request methods - MDN Web Docs
Chrome Edge CONNECT Full support. ChromeYes. Toggle history Full support. Edge12. Toggle history DELETE Full support. ChromeYes. Toggle history Full support. Edge12. Toggle history GET Full...
Read more >
Support for HTTP "MERGE" verb in Play! Framework 2.1?
MERGE won't be supported because it is not a valid HTTP method. In order to use an arbitrary HTTP method in your request,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found