Java: How to connect to an API using Java

preview_player
Показать описание
In this video, I showcase how we can connect to an API and get some JSON data from any API. I am using the metaweather API. You can find more information about the API at:
THE WEATHER API IS NOT ONLINE AT THIS MOMENT

Video about some other free APIs

My channel publishes videos regarding programming, software engineering especially Java and JavaFX. If that is what you are looking for then do not hesitate to join me on this journey!

Subscribe to my YouTube channel:
Рекомендации по теме
Комментарии
Автор

i don't know english so well to understand it but i watch it anyway

mineagent
Автор

I made a JavaFX gui login page and need the information being passed through it for the username and password can you do a video on how that works and it returns success and the token

tttttroll
Автор

Thank you for the vedio, just one question the import org.json.simple.JSONObject; and import doesn't work on my netbeans should i download a library of json.

mahmoudtimoumi
Автор

Hi, I get a java.lang.ClassCastException Exception every time I run the code. Does anyone know how to solve this?


Full error:
java.lang.ClassCastException: class org.json.simple.JSONObject cannot be cast to class org.json.simple.JSONArray (org.json.simple.JSONObject and org.json.simple.JSONArray are in unnamed module of loader 'app')
at main.main(main.java:38)

Code:
JSONParser parse = new JSONParser();
JSONArray dataObject = (JSONArray)

klausmullerlel
Автор

Spring introduced HTTP Interfaces. Less boilerplate code.

AndriusLau
Автор

I can't import JsonParser, but Jsonobject and JsonArray work

TheDuckArmy
Автор

thanks for this vid! however, after getting this data, how do you display it to your JSP or how is it implemented in a model to display in jsp etc..

LeeanRepzTraining
Автор

I use axios and makes it all easier so this java edition is quite hard to grasp honestly.

Rei-mg
Автор

1:15 Hello I simply cannot understand what are you saying there exactly could you tell me how and which maven did you add and how did you add the dependancy ? Much apriciated

Adam-nwyo
Автор

Good morning, hope you're going well. Please I have to create a simple web service and I want to connect my java code to API tool. But my java project is "Dynamic Web Projet". How can I do that for import a JSON library to make my code works?

blackwalker
Автор

thx, for noob like me - you also need to download correct JAR file and add it to depencies

crazymnd
Автор

Excuse me but it is not too clear how you call the Java api in your react code

kangnifredable
Автор

Question: this is a https url but it is a Http request. Is the information I will send in the body encrypted? I want to authenticate with a client key and secret for an api via oauth1.

leonard-riccardowecke
Автор

You didn't explain how to create this kind of project with pom.xml. What is that ?

Cengokill
Автор

Do you know how to use IMAGE MODERATION API in java?

ikelloydyana
Автор

stop scrolling 😅. you gave me a headache.

shahabshafiee
Автор

Maybe, next time, jump a bit more forth and back in the code, mark more stuff and do all of it even faster, if possible

FrissOderLassEs