From the course: Calling REST APIs with Java
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Calling Twitter Streaming API with Spring WebClient - Java Tutorial
From the course: Calling REST APIs with Java
Calling Twitter Streaming API with Spring WebClient
- [Instructor] We're going to use another unit test to practice some calls to the Twitter streaming API. Now, a couple things about this demonstration. You'll notice that we have injected the TWITTER_BEARER_TOKEN from an environment variable, so you want to make sure that's configured on your system. And then you'll see these three constants: the Twitter API domain, the stream endpoint, and the stream rules endpoint. We're also going to be doing things a little bit different with our WebClient. You'll notice that I've autowired in a builder for the WebClient from Spring. And the reason we're doing this is because when you inject the builder from Spring, you get some preconfigured codeX and other configurations by default that make it easier to work with the builder. Okay, so all that's in place, let's start building out our call. The first thing we'll need is an instance of the WebClient, so we're going to use the builder.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Twitter API5m 56s
-
(Locked)
Twitter API registration and security7m 34s
-
(Locked)
Calling APIs with Spring2m 15s
-
(Locked)
Spring WebClient7m 44s
-
(Locked)
Streaming APIs1m 39s
-
(Locked)
Calling Twitter Streaming API with Spring WebClient8m 21s
-
(Locked)
Challenge: Twitter API3m 22s
-
(Locked)
Solution: Twitter API7m 6s
-
(Locked)
-
-