348 |
*/ |
*/ |
349 |
public Request newRequest (String method, String path) |
public Request newRequest (String method, String path) |
350 |
{ |
{ |
351 |
|
if (method == null || method.length() == 0) |
352 |
|
{ |
353 |
|
throw new IllegalArgumentException("method must have non-zero length"); |
354 |
|
} |
355 |
|
if (path == null || path.length() == 0) |
356 |
|
{ |
357 |
|
throw new IllegalArgumentException("path must have non-zero length"); |
358 |
|
} |
359 |
Request ret = new Request (this, method, path); |
Request ret = new Request (this, method, path); |
360 |
ret.setHeader ("Host", hostname); |
ret.setHeader ("Host", hostname); |
361 |
ret.setHeader ("User-Agent", userAgent); |
ret.setHeader ("User-Agent", userAgent); |