java.net.MalformedURLException: no protocol 오류 해결

Yangray·2024년 11월 26일

java로 API를 호출할때 java.net.malformedurlexception 오류가 발생할 수 있는데

단순하게 'http://' 가 빠져있기 때문이다.
호출하려는 API의 URI 앞에 'http://' 를 추가해주면 된다.

EX)

uri = irsensor.testTP:30000 (X)
uri = http://irsensor.testTP:30000 (O)

new RequestEntity<>(httpHeaders, HttpMethod.GET,uri);
profile
시작은 미약하나 그 끝은 창대하리라

0개의 댓글