# Render different HTML based on HTTP method in Astro

> Learn how to render completely different HTML in an Astro page depending on the HTTP method by checking Astro.request.method for POST, GET, or DELETE.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2024-01-07 | Topics: [Astro](https://flaviocopes.com/tags/astro/) | Canonical: https://flaviocopes.com/render-different-html-based-on-http-method-in-astro/

I had the need to render completely different HTML depending on the HTTP method used to reach an [Astro](https://flaviocopes.com/astro-introduction/) page.

I used this technique:

```javascript
---
//... some server side logic
---

{Astro.request.method === 'POST' && 
  <div>
    //...
  </div>
}

{Astro.request.method === 'DELETE' && 
  <div>
    //...
  </div>
}

{Astro.request.method === 'GET' && 
  <div>
    //...
  </div>
}
```
