MCPcopy Create free account
hub / github.com/Anning01/AIMedia / patch

Method patch

pyside/api/request_handler.py:86–107  ·  view source on GitHub ↗

发送PATCH请求 :param endpoint: API接口的具体路径 :param data: PATCH请求的表单数据 :param json: PATCH请求的JSON数据 :return: 返回请求的响应

(self, endpoint, data=None, json=None)

Source from the content-addressed store, hash-verified

84 return None
85
86 def patch(self, endpoint, data=None, json=None):
87 """
88 发送PATCH请求
89 :param endpoint: API接口的具体路径
90 :param data: PATCH请求的表单数据
91 :param json: PATCH请求的JSON数据
92 :return: 返回请求的响应
93 """
94 url = f"{self.base_url}/{endpoint}"
95
96 try:
97 response = requests.patch(
98 url,
99 headers=self._build_headers(),
100 data=data,
101 json=json,
102 timeout=self.timeout,
103 )
104 return self._handle_response(response)
105 except Timeout:
106 print("请求超时")
107 return None
108
109 def delete(self, endpoint):
110 """DELETE 请求"""

Callers 2

partial_update_newsFunction · 0.95
update_accountFunction · 0.95

Calls 2

_build_headersMethod · 0.95
_handle_responseMethod · 0.95

Tested by

no test coverage detected