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

Remove msgtype requirement in HttpMessageContent

Đang mở
#407 1 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
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu trong src/System.Net.Http.Formatting/HttpMessageContent.cs tại các dòng được trích dẫn, nơi msgtype=request được thêm vào và msgtype=response được xác thực. Theo dõi ReadAsHttpResponseMessageAsync() và xác định hành vi có thể cấu hình cần thiết; hoàn thành khi các request có thể bỏ qua msgtype và các response có Content-Type: application/http được chấp nhận.

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

Mô tả

HttpMessageContent serializes HTTP requests/responses inside a mulitpart/mixed body.

For requests, it sends the header Content-Type: application/http; msgtype=request.
For responses, it expects the header Content-Type: application/http; msgtype=response.

This is where msgtype=request is added in source:
https://github.com/aspnet/AspNetWebStack/blob/1231b77d79956152831b75ad7f094f844251b97f/src/System.Net.Http.Formatting/HttpMessageContent.cs#L68

This is where msgtype=response is validated in source:
https://github.com/aspnet/AspNetWebStack/blob/1231b77d79956152831b75ad7f094f844251b97f/src/System.Net.Http.Formatting/HttpMessageContent.cs#L142-L171

HttpMessageContent should be configurable to not sent a msgtype parameter, and accept responses without a msgtype (given Content-Type: application/http).

As a common real-world example, the OData specification uses Content-Type: application/http without any further msgtype in both its batched requests and responses, see:
https://www.odata.org/documentation/odata-version-2-0/batch-processing/

Inside Microsoft, Dataverse exposes OData services and its batching endpoint is unusable with HttpMessageContent because:

  • Dataverse throws when a batch has msgtype=request in its Content-Type;
  • ReadAsHttpResponseMessageAsync() throws when parsing Dataverse response because it does not have msgtype=response.
Ngôn ngữ chính
C#
Star
897
Fork
358
Merge trung bình
40 phút
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 aspnet/AspNetWebStack

Tất cả issue của aspnet/AspNetWebStack

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.