索引 5 处的预期方案特定部分:空:
Expected scheme-specific part at index 5: null:
我在尝试使用 Spock 框架获取 HTTP get 响应时遇到以下异常。
java.net.URISyntaxException: Expected scheme-specific part at index 5: null:
def SERVER_URL = "http://localhost"
def SERVER_PORT = ":8082"
def USERNAME = "mail@gmail.com"
def PASSWORD = "123456"
def client = new RESTClient("$SERVER_URL:$SERVER_PORT")
def 'should return 200 code when used valid credentials'() {
when: 'login with valid credentials'
client.headers['Authorization'] = "Basic ${"$USERNAME:$PASSWORD".bytes.encodeBase64()}"
def response = client.get(path:'/artifactory/ui/auth/screen/footer')
从
中删除冒号
def SERVER_PORT = "8082"
或者从
中删除冒号
def client = new RESTClient("$SERVER_URL$SERVER_PORT")
端口前的冒号多了一个
我在尝试使用 Spock 框架获取 HTTP get 响应时遇到以下异常。
java.net.URISyntaxException: Expected scheme-specific part at index 5: null:
def SERVER_URL = "http://localhost"
def SERVER_PORT = ":8082"
def USERNAME = "mail@gmail.com"
def PASSWORD = "123456"
def client = new RESTClient("$SERVER_URL:$SERVER_PORT")
def 'should return 200 code when used valid credentials'() {
when: 'login with valid credentials'
client.headers['Authorization'] = "Basic ${"$USERNAME:$PASSWORD".bytes.encodeBase64()}"
def response = client.get(path:'/artifactory/ui/auth/screen/footer')
从
中删除冒号def SERVER_PORT = "8082"
或者从
中删除冒号def client = new RESTClient("$SERVER_URL$SERVER_PORT")
端口前的冒号多了一个