Skip to content

cURL import without -X/--request will detected as a 'GET' request #14523

@Jiakaic

Description

@Jiakaic

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

main

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

import cURL without '--request' or '-X' as follow:
curl --location 'https://api.openai.com/v1/chat/completions' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer $OPENAI_API_KEY' \ --data '{ "model": "gpt-4o", "messages": [ { "role": "developer", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ] }'

.that method of HTTP will be detected to 'GET'

By default, when using options like -d or --data in the command. the HTTP request will automatically be sent as a POST request.

https://curl.se/docs/manpage.html#-d

✔️ Expected Behavior

Image

❌ Actual Behavior

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions