BatchRequestItem use absolute url path instead of relative when, causing "Ressource not found" 400 error
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
Hướng nghiên cứu
Bắt đầu bằng cách truy vết BatchRequestItem và BatchRequestContent.add_request bằng ví dụ Python, sau đó kiểm tra cách URL yêu cầu được xây dựng cho các thao tác batch. Xác minh hành vi bằng bản tái hiện batch tin nhắn Outlook và xác nhận rằng mục được gửi sử dụng đường dẫn tương đối và nhận HTTP 200 mà không cần workaround.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Here is my code :
batch_requests = BatchRequestContent()
for message_id in message_ids:
query_params = MessagesRequestBuilder.MessagesRequestBuilderGetQueryParameters(
select=[
'id',
'conversationId',
'internetMessageId',
'subject',
'body',
'bodyPreview',
'from',
'toRecipients',
'ccRecipients',
'bccRecipients',
'receivedDateTime',
'sentDateTime',
'internetMessageHeaders',
'isRead',
'isDraft',
'importance',
'hasAttachments',
'categories',
]
)
request_configuration = RequestConfiguration(
query_parameters=query_params
)
request = service.me.messages.by_message_id(message_id).to_get_request_information(
request_configuration=request_configuration
)
request_id = str(uuid.uuid4())
batch_request_item = BatchRequestItem(id=request_id, request_information=request)
# batch_request_item.url = batch_request_item.url.replace('https://graph.microsoft.com/v1.0', '')
batch_requests.add_request(request_id=request_id, request=batch_request_item)
Without the line I've commented, it causes a 400 "Resource not found for the segment 'https:'".
I figured out the problem by looking at your code.
I guess it is not the behavior as you intended.
Expected behavior
The server answer a code HTTP 200
How to reproduce
1 - List message ids from Outlook
2 - Try to get the email content in batch
SDK Version
No response
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Ngôn ngữ chính
- Python
- Star
- 630
- Fork
- 96
- Merge trung bình
- 15 giờ 20 phút
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-sdk-python
-
status:waiting-for-triage type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
-
status:waiting-for-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoftgraph/msgraph-sdk-python#1563 ·
-
Needs: Attention :wave: type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoftgraph/msgraph-sdk-python#1287 · 2 bình luận · 1 reaction ·
-
Batch Request Support Đang mởstatus:waiting-for-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
microsoftgraph/msgraph-sdk-python#1557 ·
-
status:waiting-for-triage type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
microsoftgraph/msgraph-sdk-python#1556 · 1 bình luận · 1 reaction ·