Exemple #1
0
 static int putUrlAsString(String content, String url) throws HTTPException {
   int status = 0;
   try {
     try (HTTPMethod m = HTTPFactory.Put(url)) {
       m.setRequestContent(
           new StringEntity(content, ContentType.create("application/text", "UTF-8")));
       status = m.execute();
     }
   } catch (UnsupportedCharsetException uce) {
     throw new HTTPException(uce);
   }
   return status;
 }