-
Notifications
You must be signed in to change notification settings - Fork 63.2k
Closed
Labels
contentThis issue or pull request belongs to the Docs Content teamThis issue or pull request belongs to the Docs Content teamrestContent related to rest - overview.Content related to rest - overview.waiting for reviewIssue/PR is waiting for a writer's reviewIssue/PR is waiting for a writer's review
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's 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 forInvoke-WebRequest
cmdlet in Windows Powershell. So they should typecurl.exe
instead ofcurl
. 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\"]}"
- Bash
- If possible add examples that use
Invoke-WebRequest
cmdlet of PowerShell.
Additional information
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.
Metadata
Metadata
Assignees
Labels
contentThis issue or pull request belongs to the Docs Content teamThis issue or pull request belongs to the Docs Content teamrestContent related to rest - overview.Content related to rest - overview.waiting for reviewIssue/PR is waiting for a writer's reviewIssue/PR is waiting for a writer's review