TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
scott oliver
NA
82
16.2k
Problems looping through restresponse
Oct 11 2020 12:38 PM
Hello I am running into an issue writing the response from from a restSharpRequest. It gets the data fine and writes the file fine. I want to print out the information to see what I am dealing with so I can store it in a sqlite database. WHen I loop through the information it only prints one letter at a time per line. so the console prints one letter at a time. Here is a screen shot.
var restSharpClient =
new
RestClient(
"https://www.otcmarkets.com"
);
var downloadRequest =
new
RestRequest(
"research/stock-screener/api/downloadCSV?pageSize=20"
,
Method.GET);
var fileInBytes = restSharpClient.DownloadData(downloadRequest);
File.WriteAllBytes(@
"C:\Users\OpenUser\Documents\Stock Reports\OTC\OTCStockData.csv"
,
fileInBytes);
IRestResponse response = restSharpClient.Execute(downloadRequest);
foreach
(var i
in
(dynamic)(response.Content))
{
Console.WriteLine(i);
}
Reply
Answers (
1
)
System.Byte[] displayed
ConnectionString on IIS is not connected ?