07-24-2023, 08:20 AM
To test, I am sending the data using curl like so:
curl -XPOST
In test.asp I have something like this:
var byteArray = Request.BinaryRead(Request.TotalBytes);
From there I try to convert each byte to a character and append it to a string, however accessing the information seems to be the issue.
This is one attempt I have tried:
var str = "";
for (var x = 0; x < Request.TotalBytes; x++) {
str += String.fromCharCode(byteArray[x]);
}
When I check in visual studio, the data looks like this:
[![display of Array of Bytes][1]][1]
Is there a better way to get data from a request?
[1]:
curl -XPOST
[To see links please register here]
--data "{\"a\":1212321}" -H 'Content-Type: application/json'In test.asp I have something like this:
var byteArray = Request.BinaryRead(Request.TotalBytes);
From there I try to convert each byte to a character and append it to a string, however accessing the information seems to be the issue.
This is one attempt I have tried:
var str = "";
for (var x = 0; x < Request.TotalBytes; x++) {
str += String.fromCharCode(byteArray[x]);
}
When I check in visual studio, the data looks like this:
[![display of Array of Bytes][1]][1]
Is there a better way to get data from a request?
[1]: