---
# System prepended metadata

title: HTTP WIT

---

# HTTP WIT

##  `onehttp.wit`
```
interface handler {
    use { request, response, error } from types

    handle: func(req: request) -> result<response, error>
}

interface types {
    record response {
        // ...
    }
    record request {
        // ...
    }
    variant error {
        // ...
    }
}

world proxy {
    import backends: interface { *: handler }
    export frontend: handler
}
```

## `handler.wit`
```
default interface {
    use { request, response, error } from "types"

    handle: func(req: request) -> result<response, error>
}
```

## `types.wit`
```
default interface {
    record response {
        // ...
    }
    record request {
        // ...
    }
    variant error {
        // ...
    }
}
```

## `proxy.wit`
```
default world {
    import backends: interface { *: "handler" }
    import frontend: "handler"
}
```