tôi có mã này tạo ra một yêu cầu và đọc dữ liệu nhưng nó luôn luôn là trốngdữ liệu đọc từ url trả về giá trị rỗng
static string uri = "http://yiimp.ccminer.org/api/wallet?address=DshDF3zmCX9PUhafTAzxyQidwgdfLYJkBrd";
static void Main(string[] args)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Get the stream associated with the response.
Stream receiveStream = response.GetResponseStream();
// Pipes the stream to a higher level stream reader with the required encoding format.
StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
Console.WriteLine("Response stream received.");
Console.WriteLine(readStream.ReadToEnd());
response.Close();
readStream.Close();
}
Khi tôi cố gắng để truy cập vào liên kết từ trình duyệt tôi nhận json này:
{"currency": "DCR", "unsold": 0.030825917365192, "balance": 0.02007306, "unpaid": 0.05089898, "paid24h": 0.05796425, "total": 0.10886323}
Tôi đang thiếu gì?
Bạn có gặp phải bất kỳ lỗi nào không? Mã trạng thái cho yêu cầu là gì? – Jerodev
không có lỗi, chỉ cần một giá trị rỗng –