forwardemail / forwardemail/superagent

superagent returns Error: Parser is unable to parse the response

Open
#1,642 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
16.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

my script file as follows

` var url = this.buildUrl(path, pathParams);
var request = superagent(httpMethod, url);

request.type('application/json');
....
request.end((error, response) => {
if (callback) {
var data = null;
if (!error) {
try {
data = this.deserialize(response, returnType);
if (this.enableCookies && typeof window === 'undefined') {
this.agent.saveCookies(response);
}
} catch (err) {
error = err;
}
}
callback(error, data, response);
}
});`

Usually this code works fine. But when return type is 'String' it returns "Error: Parser is unable to parse the response".
I captures response frame by wireshark, it seems no problem .
![shrke](https://user-images.githubusercontent.com/41846265/133043350-4ef7edd4-9c10-4430-95f3-dc0f2bea9e63.png)
I don't know what's wrong

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.