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

Add Curl to Fetch #420

Open
wants to merge 2 commits into
base: primary
Choose a base branch
from
Open

Add Curl to Fetch #420

wants to merge 2 commits into from

Conversation

revolunet
Copy link

Thank you for opening a pull request to tiny-helpers.dev ❤️

Before you submit your PR, please take a look at the contributing guidelines. :)

To make it easier for us to review and merge your PR, please make sure …

  • you only add one (!) new helper per pull request.
  • you have checked if an open PR already exists.
  • the submitted website is focused on a single, development related issue.
  • the desc field includes an "actionable sentence" (e.g. "Create something great" or "Transform something into something else").

Thank you! 🙇‍♂️

@vercel
Copy link

vercel bot commented Mar 17, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/stefanjudis/tiny-helpers/4WBLH8DQa3s5eonFkhiSCEVXFYNi
✅ Preview: https://tiny-helpers-git-fork-revolunet-patch-1-stefanjudis.vercel.app

@stefanjudis
Copy link
Owner

@revolunet welcome to Tiny Helpers and thanks a bunch for contributing! :)

Quick question, why did you remove the other file?

I'm happy to accept your Tiny Helper and just FYI, it doesn't seem to pick up all options yet. :)

image

@revolunet
Copy link
Author

my bad for the other file, another PEBCAK issue :)

not my tool but could you please paste you curl command as text so i can have a try ?

@stefanjudis
Copy link
Owner

Here we go:

curl 'https://fooo.stefanjudis.com/api/collect' -X POST -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Referer: https://www.stefanjudis.com/' -H 'Content-Type: application/json' -H 'Origin: https://www.stefanjudis.com' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-site' -H 'Save-Data: on' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'TE: trailers' --data-raw '{"type":"pageview","payload":{"website":"xxx","hostname":"www.stefanjudis.com","screen":"1920x1080","language":"en-US","url":"/","referrer":""}}'

That's just one of the calls included on my site. 🙈

FYI – fetch is not category on Tiny Helpers. So I think HTTP, Command Line and JavaScript are the best options. :)

All that said, I'd be cool if the helper could translate all curl options. WDYT?

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

Successfully merging this pull request may close these issues.

None yet

2 participants