From the course: Calling REST APIs with Java

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Spring WebClient

Spring WebClient - Java Tutorial

From the course: Calling REST APIs with Java

Start my 1-month free trial

Spring WebClient

- To start working with Springs web client, we'll need to update one of the dependencies within our Palm.XML file. So here on line 22, I'm going to switch over to the spring boot starter web flux artifact. And this will cause spring to include its support for reactive web applications. Now, to work with the web client, we'll navigate to the Twitter search tests class. And here we have some unit tests that we can work with. I do want to point out a few things before we get started. You'll notice that I've used spring to inject my Twitter bearer token from an environment variable named TWITTER_BEARER_TOKEN. You need to establish this same environment variable on your workstation, and then add your Twitter bearer token as the value for that variable. This is exactly what we did with Azure cognitive services. You'll also notice that I've set up a constant for the Twitter API domain. And the path to the tweets search…

Contents