0

I'm building a Java application that needs to access an external Restful API.

I need to perform POST, GET and PUT on this API.

In PHP I used curl and in C# I used HTTPClient.

Which tool should I use in Java/Spring? I'm new in Java and I'm kind lost.

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
Diego Alves
  • 2,462
  • 3
  • 32
  • 65
  • 1
    Does this answer your question? [Call another rest api from my server in Spring-Boot](https://stackoverflow.com/questions/42365266/call-another-rest-api-from-my-server-in-spring-boot) – Theraloss Mar 01 '20 at 16:30

1 Answers1

1

Use RestTemplate as Spring's way of sending HTTP methods

RestTemplate offers templates for common scenarios by HTTP method, in addition to the generalized exchange and execute methods that support of less frequent cases

Here are examples of using GET/ POST/ PUT methods

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
  • In the provided link they said that RestTemplate is going to be depricated in behalf of WebClient so I'll go directly to WebClient. – Diego Alves Mar 01 '20 at 16:39