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 examples for Powershell & Command Prompt #17657

Closed
1 task done
thispsj opened this issue May 6, 2022 · 3 comments
Closed
1 task done

Add cURL examples for Powershell & Command Prompt #17657

thispsj opened this issue May 6, 2022 · 3 comments
Labels
content This issue or pull request belongs to the Docs Content team rest Content related to rest - overview. waiting for review Issue/PR is waiting for a writer's review

Comments

@thispsj
Copy link
Contributor

thispsj commented May 6, 2022

Code of Conduct

What article on docs.github.com is affected?

Every REST API reference, the index of which is this.

What part(s) of the article would you like to see updated?

All the examples of REST API endpoint requests.

We should consider some scenarios for Command Prompt & Windows Powershell/Powershell(multi-platform). I've highlighted them below :

  • The line break symbols are different in Command Prompt & Powershell. While \ is for Unix shells, ^ and ` are the symbols for making line breaks in Command Prompt & Powershell respectively.
  • Also warn the Windows Powershell users that curl is an alias for Invoke-WebRequest cmdlet in Windows Powershell. So they should type curl.exe instead of curl. For more information refer initialsession: remove curl and wget aliases PowerShell/PowerShell#1901.
  • cURL comes bundled in Windows 10 build 1804 & later.
  • Also show Command Prompt users how to use double quotes in JSON Request body correctly. An example :
    • Bash
          curl -X PUT https://api.github.com/repos/thispsj/thispsj/topics -d '{"names":["about-me"]}' 
    • Command Prompt
          curl -X PUT https://api.github.com/repos/thispsj/thispsj/topics -d "{\"names\":[\"about-me\"]}" 
  • If possible add examples that use Invoke-WebRequest cmdlet of PowerShell.

Additional information

Idea

As seen in the above screenshot we could add a drop-down list at the marked area containing options : Unix, Command Prompt, Windows Powershell & Powershell. The user can then change the snippet using drop-down which fits best to their platform.

Can give some examples here on request.

@thispsj thispsj added the content This issue or pull request belongs to the Docs Content team label May 6, 2022
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label May 6, 2022
@ramyaparimi ramyaparimi added waiting for review Issue/PR is waiting for a writer's review rest Content related to rest - overview. and removed triage Do not begin working on this issue until triaged by the team labels May 6, 2022
@ramyaparimi
Copy link
Contributor

@thispsj
Thanks so much for opening an issue! I'll triage this for the team to review 👀

@skedwards88
Copy link
Contributor

Thank you for opening this issue! I linked to it from the REST feedback discussion so that it can be considered with that project.

@gracepark
Copy link
Contributor

Thanks for the feedback! Since this is now linked to the feedback discussion I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team rest Content related to rest - overview. waiting for review Issue/PR is waiting for a writer's review
Projects
None yet
Development

No branches or pull requests

5 participants
@gracepark @skedwards88 @ramyaparimi @thispsj and others