Please tell me the steps or code to get the response code of a particlular URL.
相关问题
- Angular RxJS mergeMap types
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
This is what worked for me:
Hope this helps someone :)
. . . . . . .
HttpURLConnection:
This is by no means a robust example; you'll need to handle
IOException
s and whatnot. But it should get you started.If you need something with more capability, check out HttpClient.
You could try the following:
you can use java http/https url connection to get the response code from the website and other information as well here is a sample code.