CBRE_GSC2_122001
asked on
SSIS Httpwebrequest - GetResponseStream() error - Protocol violation
HI,
I have a SSIS package and in that I am trying to fetch a csv file from an api via URL in script task. I have tried the httpwebrequest and webclient but when I try to fetch the response I get the error as "The server committed a protocol violation. Section=ResponseStatusLine ".
Here is my code :
url_ = "#####" + n.ToString();
n = n + 50;
HttpWebRequest wc = (HttpWebRequest) WebRequest.Create(url_);
wc.Credentials = CredentialCache.DefaultCre dentials;
wc.ProtocolVersion = HttpVersion.Version11;
WebResponse wr = wc.GetResponse(); //This is where i am facing issues
Any help would be appreciated.
I have a SSIS package and in that I am trying to fetch a csv file from an api via URL in script task. I have tried the httpwebrequest and webclient but when I try to fetch the response I get the error as "The server committed a protocol violation. Section=ResponseStatusLine
Here is my code :
url_ = "#####" + n.ToString();
n = n + 50;
HttpWebRequest wc = (HttpWebRequest) WebRequest.Create(url_);
wc.Credentials = CredentialCache.DefaultCre
wc.ProtocolVersion = HttpVersion.Version11;
WebResponse wr = wc.GetResponse(); //This is where i am facing issues
Any help would be appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is probably a protocol mismatch. Is the call required to be using HTTPS rather than HTTP.
Can you use an external program such as fiddler or postman to simulate the request and see what the response is?
Fiddler: http://www.telerik.com/fiddler
Postman: https://www.getpostman.com/
Can you use an external program such as fiddler or postman to simulate the request and see what the response is?
Fiddler: http://www.telerik.com/fiddler
Postman: https://www.getpostman.com/
ASKER
Yes that is the complete error message, I tried your these 2 suggestions as well, but no luck. Still the same message.