java - Error in HttpURLConnection - openConnection -
i having following java function check website responce code:
url u = null; try { u = new url("http://bforball.com"); httpurlconnection huc = ( httpurlconnection ) u.openconnection (); huc.setrequestmethod ("get"); huc.connect () ; } i have imported below:
import java.net.httpurlconnection; but when compile code getting warning message near
u.openconnection
warning message:
connot find symbol symbol: mehod openconnection() location:variable u of type url what doing wrong?
i guess have wrong import on url class. have import url correct package :
import java.net.url; it has method openconnection()
Comments
Post a Comment