Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The curl command is correct but can't convert #failure to parse command #331

Closed
Sagiri777 opened this issue Mar 12, 2022 · 6 comments
Closed

Comments

@Sagiri777
Copy link

Error parsing curl command:
command should begin with "curl" but instead begins with "curl 'https://lulu.lulufind..."

@Sagiri777
Copy link
Author

The curl command
curl 'https://lulu.lulufind.com/mrzy/mrzypc/getAchievementDetail'  -H 'Host: lulu.lulufind.com'  -H 'Accept: application/json, text/plain, */*'  -H 'app_version: 1.0.0'  -H 'Accept-Language: zh-CN,zh-Hans;q=0.9'  -H 'Accept-Encoding: gzip, deflate, br'

@Sagiri777 Sagiri777 changed the title The curl command is correct but can't convert The curl command is correct but can't convert #failure to parse command Mar 12, 2022
@verhovsky
Copy link
Member

verhovsky commented Mar 12, 2022

If you paste your command into https://verhovs.ky/text-inspector/ , you'll see that the spaces in your command are non-breaking space characters instead of normal ASCII spaces. If you replace them with regular spaces (you can just try copying the command from your comment):

curl 'https://lulu.lulufind.com/mrzy/mrzypc/getAchievementDetail' -H 'Host: lulu.lulufind.com' -H 'Accept: application/json, text/plain, */*' -H 'app_version: 1.0.0' -H 'Accept-Language: zh-CN,zh-Hans;q=0.9' -H 'Accept-Encoding: gzip, deflate, br'

it's converted to

import requests

headers = {
    'Host': 'lulu.lulufind.com',
    'Accept': 'application/json, text/plain, */*',
    'app_version': '1.0.0',
    'Accept-Language': 'zh-CN,zh-Hans;q=0.9',
    'Accept-Encoding': 'gzip, deflate, br',
}

response = requests.get('https://lulu.lulufind.com/mrzy/mrzypc/getAchievementDetail', headers=headers)

@Sagiri777
Copy link
Author

Sagiri777 commented Mar 14, 2022 via email

@verhovsky
Copy link
Member

I'm reopening this because I want to replace the whitespace for you on the website

@verhovsky verhovsky reopened this Mar 17, 2022
@Sagiri777
Copy link
Author

I'm reopening this because I want to replace the whitespace for you on the website

Wow! Thank you! What can I do for You?

@verhovsky
Copy link
Member

verhovsky commented Mar 19, 2022

Keep using the tool and keep reporting any problems you have with is so that we can make it better.

You can also donate to the project's development https://github.com/sponsors/NickCarneiro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants