Comments (6)
Can you please also log the content of data
and its type (typeof(data)
)? This doesn't look like a byte array which it's supposed to be.
from msgpack.js.
It is a complex object. But I tried with simple string, that also not working.
[HttpGet("{id}")]
public ActionResult<string> Get(int id)
{
return "value";
}
Here is the response header.
from msgpack.js.
The thing is, the deserializeMsgPack
function expects a byte array to be passed in. A byte array consists only of bytes. A byte is an integer value in the range of 0 to 255. All of these values are handled in the code. If something else occurs, then it's not a byte array. And chances are that it needs further conversion to be deserialisable.
I'll have to create a sample project and try out myself what's happening there. I can't make any more assumptions without investigating live code.
Here's code from where I use this library. It processes data received from a WebSocket client.
function onMessage(event) {
let array = new Uint8Array(event.data);
let obj = deserialize(array);
}
event.data
is already a binary array and is then converted into a Uint8Array
. Maybe you need to do something similar.
from msgpack.js.
Okay. Let me try.
from msgpack.js.
Any news here? I can't create a demo project because the type MessagePackOutputFormatter
cannot be found anywhere. Can you maybe provide a minimal test case for this? I only know about ASP.NET Core 2.1, you seem to use 2.2. Maybe I'll have to wait a bit to run your example.
from msgpack.js.
Oops, my bad. I am able to resolve it. Full details here - https://dotnetthoughts.net/using-message-pack-with-asp-net-core/. Thank you for your response 👍
from msgpack.js.
Related Issues (20)
- Any plan to publish to NPM as a module? HOT 5
- has a bug HOT 4
- Does it work with System.Decimal? HOT 1
- Date deserialisation doesn't cope with pre-epoch dates HOT 2
- Copy to TypeScript HOT 2
- Encoding in python and decoding in javascript HOT 5
- Detect Web Workers environment HOT 3
- Wrong float deserialization from typed arrays with non-zero byteOffset
- The example of javascript client and server HOT 1
- No "default" case in 'append' HOT 2
- Doesn't handle uint64 particularly well HOT 7
- Add .d.ts typings file HOT 2
- Skip serializing properties with `undefined` values HOT 1
- DataView read wrong value on msgpack deserialized data HOT 3
- Options undocumented HOT 1
- No support for Lz4 compression as C# package provide HOT 1
- Proposal: converting Integer with DataView
- Callback for ext
- Serializer also serializes properties in object prototype HOT 1
- Wrong array serialization HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msgpack.js.