Java Reference
In-Depth Information
String book1u = "<?xml version=\"1.0\"?>"+
"<book
isbn=\"0201548550\"
pub-
year=\"1992\">"+
" <title>"+
" advanced c++"+
" </title>"+
" <author>"+
" james o. coplien"+
" </author>"+
" <publisher>"+
" addison wesley"+
" </publisher>"+
"</book>";
doPut(book1u);
doGet("0201548550");
doDelete("0201548550");
doGet(null);
}
static void doDelete(String isbn) throws Exception
{
URL url = new URL(LIBURI+((isbn != null) ? "?isb-
n="+isbn : ""));
HttpURLConnection
httpurlc
=
(HttpURLConnection)
url.openConnection();
httpurlc.setRequestMethod("delete");
httpurlc.setDoInput(true);
InputStreamReader isr;
isr
=
new
InputStreamRead-
er(httpurlc.getInputStream());
BufferedReader br = new BufferedReader(isr);
StringBuilder xml = new StringBuilder();
String line;
while ((line = br.readLine()) != null)
xml.append(line);
System.out.println(xml);
System.out.println();
Search WWH ::




Custom Search