Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrem committed Dec 6, 2024
2 parents d824cc6 + 3f5d98f commit 0b3aac1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions office365/sharepoint/files/file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
from typing import TYPE_CHECKING, AnyStr
from urllib.parse import quote

import requests

Expand Down Expand Up @@ -607,8 +608,11 @@ def save_binary(context, server_relative_url, content):
:type server_relative_url: str
:type content: str
"""
url = r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
context.service_root_url(), server_relative_url
url = quote(
r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
context.service_root_url(), server_relative_url
),
safe=":/",
)
request = RequestOptions(url)
request.method = HttpMethod.Post
Expand All @@ -626,8 +630,11 @@ def open_binary(context, server_relative_url):
:type server_relative_url: str
:return Response
"""
url = r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
context.service_root_url(), server_relative_url
url = quote(
r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
context.service_root_url(), server_relative_url
),
safe=":/",
)
request = RequestOptions(url)
request.method = HttpMethod.Get
Expand Down

0 comments on commit 0b3aac1

Please sign in to comment.