# pg_net — Postgres extension

> Send HTTP requests from SQL, triggers and cron jobs.

Source: https://scribase.com/extensions/pg_net

Category: APIs and HTTP. Version: 0.20.4. Optional, enabled per project.

## About

pg_net queues HTTP requests from SQL and sends them from a background worker, so a trigger can call a webhook without waiting for the response inside the transaction. Responses land in net._http_response for a while so you can check them.

## Enable it

```sql
create extension if not exists pg_net with schema extensions;
```

## Example

```sql
select net.http_post(
  url := 'https://example.com/hooks/order-paid',
  body := jsonb_build_object('order_id', 42),
  headers := '{"Content-Type": "application/json"}'::jsonb
) as request_id;

-- later: the response for that request id
select status_code, content from net._http_response where id = 1;
```

Upstream: https://github.com/supabase/pg_net