Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Unable to get Streams using batched requests, Length always zero

Đang mở
#945 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu với BatchRequestContentCollection.AddBatchRequestStepAsync, Batch.PostAsync và GetResponseStreamByIdAsync bằng cách sử dụng yêu cầu nội dung drive-item được cung cấp. So sánh phản hồi theo lô với phản hồi trực tiếp của Content.GetAsync và kiểm tra các header cùng stream được trả về. Được xem là hoàn tất khi các phản hồi stream theo lô chứa nội dung được yêu cầu thay vì Content-Length: 0.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Needs: Attention :wave: type:bug
Describe the bug

When using BatchRequestContentCollection (or BatchRequestContent) to request a stream content it only returns an empty stream (Length = 0). This happens regardless of whether there is a single or multiple requests in the collection.

var batchRequestContentCollection = new BatchRequestContentCollection(_graphClient);
var driveItemRequest = _graphClient.Drives[driveId].Items[driveItemId].Content.ToGetRequestInformation();
var requestId = await batchRequestContentCollection.AddBatchRequestStepAsync(driveItemRequest);
var batchResponse = await _graphClient.Batch.PostAsync(batchRequestContentCollection);
var stream = await batchResponse.GetResponseStreamByIdAsync(requestId);

I also tried to just use GetResponseByIdAsync, Header information says

Content-Type: application/octet-stream
Content-Length: 0

This does not occur when doing a single request without batching:

var stream = await _graphClient.Drives[driveId].Items[driveItemId].Content.GetAsync();

The stream gets returned correctly then.

Expected behavior

Batched requests should return stream content correctly.

How to reproduce
var batchRequestContentCollection = new BatchRequestContentCollection(_graphClient);
var driveItemRequest = _graphClient.Drives[driveId].Items[driveItemId].Content.ToGetRequestInformation();
var requestId = await batchRequestContentCollection.AddBatchRequestStepAsync(driveItemRequest);
var batchResponse = await _graphClient.Batch.PostAsync(batchRequestContentCollection);
var stream = await batchResponse.GetResponseStreamByIdAsync(requestId);
SDK Version

3.2.1

Latest version known to work for scenario above?

don't know

Configuration
  • OS: Windows 11
  • x64
Ngôn ngữ chính
C#
Star
163
Fork
65
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoftgraph/msgraph-sdk-dotnet-core

Tất cả issue của microsoftgraph/msgraph-sdk-dotnet-core

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.