refac/fix: support delete method for openapi tool servers
This commit is contained in:
@@ -754,7 +754,7 @@ async def execute_tool_server(
|
|||||||
) as session:
|
) as session:
|
||||||
request_method = getattr(session, http_method.lower())
|
request_method = getattr(session, http_method.lower())
|
||||||
|
|
||||||
if http_method in ["post", "put", "patch"]:
|
if http_method in ["post", "put", "patch", "delete"]:
|
||||||
async with request_method(
|
async with request_method(
|
||||||
final_url,
|
final_url,
|
||||||
json=body_params,
|
json=body_params,
|
||||||
|
|||||||
@@ -494,7 +494,10 @@ export const executeToolServer = async (
|
|||||||
headers
|
headers
|
||||||
};
|
};
|
||||||
|
|
||||||
if (['post', 'put', 'patch'].includes(httpMethod.toLowerCase()) && operation.requestBody) {
|
if (
|
||||||
|
['post', 'put', 'patch', 'delete'].includes(httpMethod.toLowerCase()) &&
|
||||||
|
operation.requestBody
|
||||||
|
) {
|
||||||
requestOptions.body = JSON.stringify(bodyParams);
|
requestOptions.body = JSON.stringify(bodyParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user