Spring Boot

RestTemplate & WebClient

HTTP calls with RestTemplate (synchronous) and WebClient (reactive), error handling, interceptors

24 питань зі співбесід·
Mid-Level
1

What is the status of RestTemplate in recent Spring versions?

Відповідь

RestTemplate has been in maintenance mode since Spring 5 and is no longer actively developed. Spring recommends using WebClient, a more modern and performant non-blocking reactive API. RestTemplate remains supported for compatibility with existing code, but new projects should prefer WebClient.

2

Which RestTemplate method returns only the response body?

Відповідь

getForObject directly returns the deserialized object from the HTTP response body, without metadata (status, headers). This method is convenient for simple cases where only data is needed. To access headers or HTTP status, use getForEntity which returns a complete ResponseEntity.

3

Which RestTemplate method allows access to the HTTP status and response headers?

Відповідь

getForEntity returns a ResponseEntity that encapsulates the response body, HTTP status code and headers. This method is useful when it's necessary to inspect response metadata, such as checking the status or reading a custom header. For simple cases where only the body is needed, getForObject is sufficient.

4

Which RestTemplate method offers the most control over the HTTP request?

5

Which component allows customization of HTTP error handling in RestTemplate?

+21 питань зі співбесід

Інші теми співбесід Spring Boot

Spring Core - IoC & DI

Junior
22 запитань

Spring Boot Auto-Configuration

Junior
20 запитань

Spring Boot Starters

Junior
18 запитань

Application Properties & YAML

Junior
16 запитань

Logging with SLF4J & Logback

Junior
20 запитань

Spring Boot DevTools

Junior
15 запитань

Spring MVC Basics

Mid-Level
20 запитань

Spring REST Controllers

Mid-Level
20 запитань

Request & Response Handling

Mid-Level
20 запитань

Exception Handling

Mid-Level
25 запитань

Bean Validation

Mid-Level
25 запитань

Spring Data JPA Basics

Mid-Level
25 запитань

JPA Entities & Relationships

Mid-Level
30 запитань

JPA Queries

Mid-Level
30 запитань

Spring Data Repositories

Mid-Level
25 запитань

Spring Security Basics

Mid-Level
25 запитань

Spring Boot Actuator

Mid-Level
20 запитань

Unit Testing with JUnit & Mockito

Mid-Level
30 запитань

Spring Boot Testing

Mid-Level
30 запитань

Profiles & Environment

Mid-Level
20 запитань

Async & Scheduling

Mid-Level
25 запитань

Caching with Spring

Mid-Level
25 запитань

Spring WebFlux (Reactive)

Mid-Level
25 запитань

Spring Transactions

Senior
30 запитань

Advanced Authentication & Authorization

Senior
30 запитань

JWT & Stateless Security

Senior
20 запитань

OAuth2 & Authorization Server

Senior
20 запитань

Spring Boot & Docker

Senior
19 запитань

Microservices with Spring

Senior
25 запитань

Spring Cloud Config

Senior
19 запитань

Performance Optimization

Senior
30 запитань

GraalVM Native Images

Senior
20 запитань

Опануй Spring Boot для наступної співбесіди

Отримай доступ до всіх питань, flashcards, технічних тестів, вправ code review та симуляторів співбесід.

Почни безкоштовно