# Server HTTP (Go) > net/http, handlers, ServeMux, middleware, request/response, routing, context - 24 domande da colloquio - Mid-Level - [Domande da colloquio: Go](https://sharpskill.dev/it/technologies/go/domande-colloquio.md) ## 1. Cos'è il package net/http in Go? **Risposta** Il package net/http fornisce le funzionalità per creare server e client HTTP. Include tipi come http.Server, http.Handler, http.Request, http.ResponseWriter e funzioni come ListenAndServe. È la libreria standard di Go per HTTP, utilizzata nella maggior parte delle applicazioni web senza dipendenze esterne. ## 2. Come creare un server HTTP semplice in Go? **Risposta** La funzione http.ListenAndServe avvia un server HTTP su una determinata porta con un handler. Accetta due parametri: l'indirizzo (es: ':8080') e un handler (può essere nil per usare DefaultServeMux). È il metodo più semplice per avviare un server, blocca l'esecuzione finché non si verifica un errore. ## 3. Cos'è un http.Handler in Go? **Risposta** Un http.Handler è un'interfaccia con un unico metodo ServeHTTP(ResponseWriter, *Request). Qualsiasi tipo che implementa questo metodo può gestire richieste HTTP. È il contratto di base per creare handler personalizzati, middleware e router. Tutti i framework web di Go usano questa interfaccia come fondamento. ## Altre 21 domande disponibili - Qual è la differenza tra http.Handler e http.HandlerFunc? - A cosa serve http.ServeMux? Registrati gratis: https://sharpskill.dev/it/login ## Altri argomenti di colloquio Go - [Fondamenti di Go](https://sharpskill.dev/it/technologies/go/domande-colloquio/go-basics.md): 25 domande, Junior - [Strutture dati in Go](https://sharpskill.dev/it/technologies/go/domande-colloquio/go-data-structures.md): 20 domande, Junior - [Interfacce in Go](https://sharpskill.dev/it/technologies/go/domande-colloquio/go-interfaces.md): 18 domande, Junior - [Gestione degli errori](https://sharpskill.dev/it/technologies/go/domande-colloquio/error-handling.md): 20 domande, Junior - [Goroutine di base](https://sharpskill.dev/it/technologies/go/domande-colloquio/goroutines-basics.md): 20 domande, Junior - [Channels](https://sharpskill.dev/it/technologies/go/domande-colloquio/channels.md): 22 domande, Junior - [Go Modules](https://sharpskill.dev/it/technologies/go/domande-colloquio/go-modules.md): 18 domande, Mid-Level - [Client HTTP](https://sharpskill.dev/it/technologies/go/domande-colloquio/http-client.md): 18 domande, Mid-Level - [Codifica JSON](https://sharpskill.dev/it/technologies/go/domande-colloquio/json-encoding.md): 20 domande, Mid-Level - [Database/SQL](https://sharpskill.dev/it/technologies/go/domande-colloquio/database-sql.md): 22 domande, Mid-Level - [Pacchetto context](https://sharpskill.dev/it/technologies/go/domande-colloquio/context-package.md): 20 domande, Mid-Level - [Testing](https://sharpskill.dev/it/technologies/go/domande-colloquio/testing.md): 22 domande, Mid-Level - [Pattern di concorrenza](https://sharpskill.dev/it/technologies/go/domande-colloquio/concurrency-patterns.md): 24 domande, Mid-Level - [Primitive di sincronizzazione](https://sharpskill.dev/it/technologies/go/domande-colloquio/sync-primitives.md): 22 domande, Mid-Level - [Framework web Go](https://sharpskill.dev/it/technologies/go/domande-colloquio/go-web-frameworks.md): 20 domande, Mid-Level - [Progettazione di API REST](https://sharpskill.dev/it/technologies/go/domande-colloquio/rest-api-design.md): 20 domande, Mid-Level - [gRPC](https://sharpskill.dev/it/technologies/go/domande-colloquio/grpc.md): 22 domande, Mid-Level - [Reflection](https://sharpskill.dev/it/technologies/go/domande-colloquio/reflection.md): 20 domande, Senior - [Gestione della memoria](https://sharpskill.dev/it/technologies/go/domande-colloquio/memory-management.md): 24 domande, Senior - [Ottimizzazione delle prestazioni](https://sharpskill.dev/it/technologies/go/domande-colloquio/performance-optimization.md): 22 domande, Senior - [Generics](https://sharpskill.dev/it/technologies/go/domande-colloquio/generics.md): 20 domande, Senior - [Go Design Patterns](https://sharpskill.dev/it/technologies/go/domande-colloquio/design-patterns.md): 24 domande, Senior - [Microservices](https://sharpskill.dev/it/technologies/go/domande-colloquio/microservices.md): 24 domande, Senior - [Sicurezza e autenticazione](https://sharpskill.dev/it/technologies/go/domande-colloquio/security-authentication.md): 24 domande, Senior - [Docker & Containerization](https://sharpskill.dev/it/technologies/go/domande-colloquio/docker-containerization.md): 20 domande, Senior - [Kubernetes Basics](https://sharpskill.dev/it/technologies/go/domande-colloquio/kubernetes-basics.md): 22 domande, Senior - [Go Avanzato](https://sharpskill.dev/it/technologies/go/domande-colloquio/advanced-go.md): 20 domande, Senior - [Sviluppo CLI](https://sharpskill.dev/it/technologies/go/domande-colloquio/cli-development.md): 20 domande, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/it/technologies/go/domande-colloquio/http-server