mirror of https://github.com/langgenius/dify.git
fix: node.js sdk if request is a get data must not exist (#4618)
This commit is contained in:
parent
11275cbaaf
commit
af026c5953
|
@ -85,7 +85,7 @@ export class DifyClient {
|
||||||
response = await axios({
|
response = await axios({
|
||||||
method,
|
method,
|
||||||
url,
|
url,
|
||||||
data,
|
...(method !== "GET" && { data }),
|
||||||
params,
|
params,
|
||||||
headers,
|
headers,
|
||||||
responseType: "json",
|
responseType: "json",
|
||||||
|
|
|
@ -42,7 +42,6 @@ describe('Send Requests', () => {
|
||||||
expect(axios).toHaveBeenCalledWith({
|
expect(axios).toHaveBeenCalledWith({
|
||||||
method,
|
method,
|
||||||
url: `${BASE_URL}${endpoint}`,
|
url: `${BASE_URL}${endpoint}`,
|
||||||
data: null,
|
|
||||||
params: null,
|
params: null,
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${difyClient.apiKey}`,
|
Authorization: `Bearer ${difyClient.apiKey}`,
|
||||||
|
|
Loading…
Reference in New Issue