Hello. I am changing the post request body through a script:
static function OnBeforeRequest(oSession: Session) {
if (oSession.fullUrl=="https://www.example.com/api/v1/device") {
var rep = System.IO.File.ReadAllBytes("replace.txt");
oSession.requestBodyBytes = rep;
}
If I do not change the request body, the server accepts it (301). If I use a script, the server throws an error (401). The data in replace.txt is completely identical to the data from the original request that the server accepts. What could be the problem?