12

I'm writing my README.md file for a Github repository, which contains some requisitions written for manual testing the application. The tool I use to make the manual tests is the REST Client extension for VSCode.

I want to show the manual tests highlighted on the front page of the repository, on the README. If it was some javascript, I could write something like:

```javascript
   console.log("Hello World")
```

Github would recognize the code between the ``` and highlight it as javascript. But how can I do it for HTTP headers like these ones?

```http
   ### Expect { message: 'Wellcome to TestsAPI'}
   GET http://localhost:5001/

   ### Expect code 201 and info about the new user
   POST http://localhost:5001/user
   Content-Type: application/json

   {
     "name": "Pitossomo",
     "email": "[email protected]" 
   }
   
   ### Expect code 400
   POST http://localhost:5001/user
   Content-Type: application/json

   { 
     "name": "",
     "email": "" 
   }
   ```

In the example, there are 3 requisitions that can be made my the VSCode REST Client extension, separated by the ###. I put the ```http but it does not work, maybe there is some other word to refer to http headers?

Searching in google I've found the reference for the documentation of Highligh.js, but it does not specifies the word used by Github

3
  • 5
    You can just specify the http language for the code block exactly as you have shown in your example. Make sure to not indent the block and only use valid HTTP (by e.g. removing the comment and putting out outside the http code block if required). If this didn't work for you, please show what exactly you have entered and how it wasn;t rendered as expected. Commented Jul 27, 2022 at 10:32
  • As for supported code languages within markdown on GitHub, please refer to the documentation. Commented Jul 27, 2022 at 10:34
  • @HolgerJust please consider posing your answer as an answer. You'll likely get points for it and then we won't see this as unanswered. Commented Mar 3, 2024 at 18:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.