Support for JSON merge-patch
See original GitHub issueIt looks like super agent doesn’t support JSON merge-patches with Content-Type: application/merge-patch+json
. When I try to send(...)
a JSON value it comes out on the other side empty:
const req = request(app)
.patch(url)
.set("Content-Type", "application/merge-patch+json")
.send(entity);
.expect('Content-Type', /json/)
.expect(200);
To reiterate, on the server side, req.body
is actually empty.
I haven’t looked at the code but if I had to guess I’d gues sthat send(..)
is doing some conversion stuff depending on what Content-Type
is set to, which makes sense, but it would be nice in general if I could turn it off, or specify what the body is concretely to avoid this problem.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
12 Updating a JSON Document with JSON Merge Patch
JSON Merge Patch is suitable for updating JSON documents that primarily use objects for their structure and do not make use of explicit...
Read more >json-merge-patch - npm
Implementation of JSON Merge Patch (RFC 7396). ... Start using json-merge-patch in your project by running `npm i json-merge-patch`.
Read more >JSON Merge Patch - JSON for Modern C++
The library supports JSON Merge Patch (RFC 7386) as a patch format. The merge patch format is primarily intended for use with the...
Read more >JsonMergePatch support for ASP.NET Core - GitHub
JSON Merge Patch support for ASP.NET Core ; var backendModel = ; var mergePatch = ; var newObject = ; using Morcatko ·...
Read more >RFC 7386: JSON Merge Patch
RFC 7386 JSON Merge Patch October 2014 Table of Contents 1. Introduction . ... Introduction This specification defines the JSON merge patch document...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@t3hmrman I started a PR to address this, but I can’t get a test to reproduce the issue. Could you check if the test I wrote is wrong somehow? https://github.com/visionmedia/superagent/pull/1441
Just found out it’s a
bugfeature inbody-parser
from a ticket in 2015.My apologies @deiga thanks for looking at this