# HTTP 클라이언트 (Go) > http.Client, 요청, 타임아웃, transport, 리다이렉트, cookie, 커스텀 헤더 - 18 면접 질문 - Mid-Level - [면접 질문: Go](https://sharpskill.dev/ko/technologies/go/interview-questions.md) ## 1. http.Get와 http.Client.Get의 주요 차이점은 무엇입니까? **답변** http.Get는 커스터마이징이 불가능한 기본 HTTP 클라이언트(http.DefaultClient)를 사용하는 반면, http.Client.Get는 타임아웃, 리다이렉트 정책, 커스텀 transport 같은 파라미터를 설정할 수 있습니다. 프로덕션에서는 요청 동작을 제어하고 무기한 블로킹을 피하기 위해 커스텀 HTTP 클라이언트를 만드는 것이 권장됩니다. ## 2. http.Client.Timeout가 설정되지 않으면 어떻게 됩니까? **답변** 명시적인 타임아웃이 없으면 HTTP 클라이언트는 서버 응답을 무기한 기다리며, 서버가 응답하지 않으면 애플리케이션을 블로킹할 수 있습니다. 기본 타임아웃은 0이며, 이는 시간 제한이 없음을 의미합니다. 블로킹된 goroutine과 리소스 누수를 피하기 위해 프로덕션에서는 항상 합리적인 타임아웃을 설정하세요. ## 3. HTTP 요청에 커스텀 헤더를 추가하는 방법은 무엇입니까? **답변** 커스텀 헤더는 http.NewRequest로 요청을 생성한 후 http.Request.Header.Set() 또는 Header.Add()를 통해 추가합니다. Set 메서드는 기존 값을 대체하고 Add는 같은 키에 새 값을 추가합니다. 이 방식은 인증, 콘텐츠 협상 또는 커스텀 식별자를 통한 요청 추적에 필요합니다. ## 15개 추가 질문 이용 가능 - response.Body.Close()를 호출하는 것이 왜 중요합니까? - 서버에 JSON 데이터를 보낼 수 있는 HTTP 메서드는 무엇입니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Go 면접 주제 - [Go 기초](https://sharpskill.dev/ko/technologies/go/interview-questions/go-basics.md): 25개 질문, Junior - [Go 데이터 구조](https://sharpskill.dev/ko/technologies/go/interview-questions/go-data-structures.md): 20개 질문, Junior - [Go 인터페이스](https://sharpskill.dev/ko/technologies/go/interview-questions/go-interfaces.md): 18개 질문, Junior - [에러 처리](https://sharpskill.dev/ko/technologies/go/interview-questions/error-handling.md): 20개 질문, Junior - [Goroutine 기초](https://sharpskill.dev/ko/technologies/go/interview-questions/goroutines-basics.md): 20개 질문, Junior - [Channels](https://sharpskill.dev/ko/technologies/go/interview-questions/channels.md): 22개 질문, Junior - [Go Modules](https://sharpskill.dev/ko/technologies/go/interview-questions/go-modules.md): 18개 질문, Mid-Level - [HTTP 서버](https://sharpskill.dev/ko/technologies/go/interview-questions/http-server.md): 24개 질문, Mid-Level - [JSON 인코딩](https://sharpskill.dev/ko/technologies/go/interview-questions/json-encoding.md): 20개 질문, Mid-Level - [Database/SQL](https://sharpskill.dev/ko/technologies/go/interview-questions/database-sql.md): 22개 질문, Mid-Level - [context 패키지](https://sharpskill.dev/ko/technologies/go/interview-questions/context-package.md): 20개 질문, Mid-Level - [Testing](https://sharpskill.dev/ko/technologies/go/interview-questions/testing.md): 22개 질문, Mid-Level - [동시성 패턴](https://sharpskill.dev/ko/technologies/go/interview-questions/concurrency-patterns.md): 24개 질문, Mid-Level - [동기화 프리미티브](https://sharpskill.dev/ko/technologies/go/interview-questions/sync-primitives.md): 22개 질문, Mid-Level - [Go 웹 프레임워크](https://sharpskill.dev/ko/technologies/go/interview-questions/go-web-frameworks.md): 20개 질문, Mid-Level - [REST API 설계](https://sharpskill.dev/ko/technologies/go/interview-questions/rest-api-design.md): 20개 질문, Mid-Level - [gRPC](https://sharpskill.dev/ko/technologies/go/interview-questions/grpc.md): 22개 질문, Mid-Level - [Reflection](https://sharpskill.dev/ko/technologies/go/interview-questions/reflection.md): 20개 질문, Senior - [메모리 관리](https://sharpskill.dev/ko/technologies/go/interview-questions/memory-management.md): 24개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/go/interview-questions/performance-optimization.md): 22개 질문, Senior - [Generics](https://sharpskill.dev/ko/technologies/go/interview-questions/generics.md): 20개 질문, Senior - [Go Design Patterns](https://sharpskill.dev/ko/technologies/go/interview-questions/design-patterns.md): 24개 질문, Senior - [Microservices](https://sharpskill.dev/ko/technologies/go/interview-questions/microservices.md): 24개 질문, Senior - [보안 및 인증](https://sharpskill.dev/ko/technologies/go/interview-questions/security-authentication.md): 24개 질문, Senior - [Docker & Containerization](https://sharpskill.dev/ko/technologies/go/interview-questions/docker-containerization.md): 20개 질문, Senior - [Kubernetes Basics](https://sharpskill.dev/ko/technologies/go/interview-questions/kubernetes-basics.md): 22개 질문, Senior - [고급 Go](https://sharpskill.dev/ko/technologies/go/interview-questions/advanced-go.md): 20개 질문, Senior - [CLI 개발](https://sharpskill.dev/ko/technologies/go/interview-questions/cli-development.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/go/interview-questions/http-client