
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Response msgpack content
Response msgpack content
Can someone tell me how to decode the data if it is in the form of an msgpack? 

- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Response msgpack content
I've never used that format but perhaps these projects can help you :
https://github.com/arthurprs/msgpack-delphi
https://github.com/ymofen/msgpack-delphi
https://github.com/arthurprs/msgpack-delphi
https://github.com/ymofen/msgpack-delphi
Re: Response msgpack content
Yes, I've seen it, as well as the online converter. https://msgpack.solder.party/
Example of ResponseFilterBrowser
How do I get this data in binary form? It's not clear what's in FStream.
In a regular browser, it looks like this - https://postimg.cc/wR6wsp30
Example of ResponseFilterBrowser
How do I get this data in binary form? It's not clear what's in FStream.

In a regular browser, it looks like this - https://postimg.cc/wR6wsp30
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Response msgpack content
The ResponseFilterBrowser can be modified to copy the raw binary contents of any resource to FStream.
See these functions and read all the code comments in the demo and the interface methods used by the demo :
See these functions and read all the code comments in the demo and the interface methods used by the demo :
- TResponseFilterBrowserFrm.IsMyResource
- TResponseFilterBrowserFrm.CopyScript
Re: Response msgpack content
Everything is clear with this, but how to read data from an FStream correctly?
I found examples on the internet, but it doesn't work(
The online converter does not accept this result.
I found examples on the internet, but it doesn't work(
The online converter does not accept this result.
Code: Select all
function BitStreamToHexStr(AStream: TMemoryStream): string;
const
HexArr: array[0..15] of char = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
var
AByte: Byte;
i: Integer;
begin
SetLength(Result, AStream.Size * 2);
for i := 0 to AStream.Size - 1 do
begin
AByte := PByteArray(AStream.Memory)[i];
Result[i * 2 + 1] := HexArr[AByte shr 4];
Result[i * 2 + 2] := HexArr[AByte and $0F];
end;
end;
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Response msgpack content
There are many ways to do that and you'll probably find simpler code that this but try this example to convert a stream to TBytes :
https://docwiki.embarcadero.com/CodeExamples/Sydney/en/TStreamReadBuffer_(Delphi)
If the framework you use doesn't support TBytes as input then convert each byte to hex with IntToHex
https://docwiki.embarcadero.com/CodeExamples/Sydney/en/TStreamReadBuffer_(Delphi)
If the framework you use doesn't support TBytes as input then convert each byte to hex with IntToHex