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.
Solution: Twitter API - Java Tutorial
From the course: Calling REST APIs with Java
Solution: Twitter API
(upbeat music) - [Instructor] Okay, I'll show you my solution to the challenge but keep in mind, you can solve this in many different ways. I started my work inside of the stream method within the Twitter streaming service class here I instantiated a client using the builder that was injected into the class by spring. The first thing I needed to do to create the client was specified the base URL, which is the Twitter API domain. I then added a default header to satisfy the OAuth two security scheme on the Twitter API. By specifying a default header that provided our bearer token on the client. It causes the bearer token to be sent with every request. Once I had this security in place I then called the build method to instantiate the client. Next, it was on to making the call that would connect our client to the stream that's provided by the Twitter streaming API. To make that connection. I needed to use the fluent API of…
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)
-
-