HttpMethod
The method of an HTTP request, in its colour and in words: GET, POST, DELETE.
import { HttpMethod } from '@sypnia/ui/react'
On this page
Methods
Each method in its tone.
GETPOSTPUTPATCHDELETEOPTIONS
Code
import { HttpMethod } from '@sypnia/ui/react';
// Reading is calm, writing is green, changing is amber, deleting is red; the word is always there too.
export default function Methods() {
return <div className="sy-row">{['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'].map((m) => <HttpMethod key={m} method={m} />)}</div>;
} When to use it
Use it when
- Lists of endpoints, requests in logs.
Do not use it when
- It is not a request: Badge.
For everyone
- The word is always there; colour only repeats it.
Props
| HttpMethod | Type | Default |
|---|---|---|
methodrequired | string |