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

Does not recognize --data-binary or --compressed #40

Open
mglass222 opened this issue Oct 3, 2020 · 7 comments
Open

Does not recognize --data-binary or --compressed #40

mglass222 opened this issue Oct 3, 2020 · 7 comments

Comments

@mglass222
Copy link

mglass222 commented Oct 3, 2020

Tried both copy as curl-bash and copy as curl-cmd (working on windows machine here, ananconda 3)

Here is the call:

uncurl "curl 'https://www.bestbuy.com/cart/api/v1/addToCart'
-H 'authority: www.bestbuy.com'
-H 'accept: application/json'
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36'
-H 'content-type: application/json; charset=UTF-8'
-H 'origin: https://www.bestbuy.com'
-H 'sec-fetch-site: same-origin'
-H 'sec-fetch-mode: cors'
-H 'sec-fetch-dest: empty'
-H 'referer: https://www.bestbuy.com/site/evga-ko-ultra-gaming-nvidia-geforce-rtx-2060-6gb-gddr6-pci-express-3-0-graphics-card-black-gray/6403801.p?skuId=6403801'
-H 'accept-language: en-US,en;q=0.9'
-H 'cookie: redacted'
--data-binary '{"items":[{"skuId":"6403801"}]}'
--compressed"

File "", line 13
--data-binary '{"items":[{"skuId":"6403801"}]}' \

^
SyntaxError: invalid syntax

@mglass222 mglass222 changed the title Does not work in the following. What am i doing wrong? Does not recognize --data-binary Oct 3, 2020
@mglass222 mglass222 changed the title Does not recognize --data-binary Does not recognize --data-binary or --compressed Oct 3, 2020
@spulec
Copy link
Owner

spulec commented Oct 3, 2020

Hmmm, that works for me.

Can you let me know which version of uncurl, python, and your OS? If you have a full stacktrace, that would be helpful too.

@mglass222
Copy link
Author

Here's a screenshot:

uncurl

@mglass222
Copy link
Author

Windows 10, Anaconda 3, Jupyter Notebook

@spulec
Copy link
Owner

spulec commented Oct 4, 2020

What version of uncurl?

@mglass222
Copy link
Author

Version: 0.0.10

@NoahCardoza
Copy link

I'm having the same problem ☹️

@spulec
Copy link
Owner

spulec commented Oct 5, 2020

I took another look at your screenshot. It looks like you are trying to use this in Python vs on the command line?

If so, here is the API you want to use:

import uncurl

print(uncurl.parse("curl 'https://pypi.python.org/pypi/uncurl' -H 'Accept-Encoding: gzip,deflate,sdch'"))

Note that for anything inside of the data-binary, you will want to use proper string escaping if you have quotes inside of your quotes (or use triple quotes on the entire string).

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

No branches or pull requests

3 participants