mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #927] [bug] import cURL not working properly #329
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#329
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mandaputtra on GitHub (Jun 8, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/927
Originally assigned to: @AndrewBastin on GitHub.
Describe the bug
Import curl with the Copy as Curl result on browser network tab doesn't really work.
Broken cURL flags:
--data-raw--urlx-www-form-urlencodedmultipart/form-dataTo Reproduce
Steps to reproduce the behavior:
datarequestsection are emptymy curl example
Expected behavior
Able import curl from browser pane, the file doesn't matter if it
form-url-encodedwith file, just make the filenullDesktop (please complete the following information):
Additional context
I stated the problem in other API-testing too, take a look here and here
@LeoMartinDev commented on GitHub (Oct 4, 2020):
Looks like
--data-rawis not supported, please use--datainstead which workscurl 'http://127.0.0.1:8000/api/admin/crm/brand/4' -X PUT -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en' --compressed -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6Ly9pcmlzLmxvY2FsL2FwaS9hZG1pbi9sb2dpbiIsImlhdCI6MTU2ODIwMjU3OSwiZXhwIjoxNTY4MjA2MTc5LCJuYmYiOjE1NjgyMDI1NzksImp0aSI6IkphUXk1cTFSa0NMeXJyam4ifQ.OoTNsJmERVAozUaWm4K9TRevZHuw1kC6QpWdth0pN2A' -H 'Content-Type: application/json;charset=utf-8' -H 'Origin: http://localhost:3012' -H 'Connection: keep-alive' -H 'Referer: http://localhost:3012/crm/company/4' --data '{"id":4,"crm_company_id":4,"industry_primary_id":2,"industry_head_id":2,"industry_body_id":2,"code":"01","barcode":"222010101","summary":"Healt-Seasoning-Basic-Hori-Kello","name":"Kellolaa","sub_code":"01","sub_name":"Hori","created_at":"2020-06-08 08:50:02","updated_at":"2020-06-08 08:50:02","company":4,"primary":{"id":2,"code":"2","name":"Healt","created_at":"2020-05-19 07:05:02","updated_at":"2020-05-19 07:09:28"},"head":{"id":2,"code":"2","name":"Seasoning","created_at":"2020-04-14 19:34:33","updated_at":"2020-04-14 19:34:33"},"body":{"id":2,"code":"2","name":"Basic","created_at":"2020-04-14 19:33:54","updated_at":"2020-04-14 19:33:54"},"contacts":[]}'`
@liyasthomas commented on GitHub (Oct 5, 2020):
Reopen if there're further issues.
@AntonioRedondo commented on GitHub (Nov 30, 2021):
I just came across with this issue. Populating headers from the cURL query works, but not the body payload.
In the below cURL POST HTTP request with content type
multipart/form-datathe two parametersEmailAddressandEntityof the body payload aren't parsed from the cURL query. And changing--data-rawto--datadoesn't fix the issue:@nilay1221 commented on GitHub (Dec 9, 2021):
@AntonioRedondo I reproduced the issue but it's working fine for me. Attaching video for the same.
https://user-images.githubusercontent.com/44199023/145417888-2a35c501-4882-485c-8bb7-6da0d703f971.mp4
@AntonioRedondo commented on GitHub (Dec 9, 2021):
Hi @nilay1221, thanks for having a look at this issue.
Did you try to import my cURL command into Hoppscotch and see whether the body parameters were populated?
@nilay1221 commented on GitHub (Dec 9, 2021):
Yes i did and it didn't populate the multipart/form data. Understood your issue. Thank you
@AndrewBastin commented on GitHub (Jan 27, 2022):
@kyteinsky can you look into this on your PR as well ?