I wrote some code last year that should get you started, see my blog for more details.
It uses GeoServer Manager to handle the rest calls:
private void createStyle(String table, File styleDir) {
// We always search for name + "." otherwise rail matches railstations etc.
File styleFile = null;
for (File file : styleDir.listFiles()) {
if (file.getName().toLowerCase().startsWith(table + ".")) {
styleFile = file;
break;
}
}
if (styleFile == null) {
// try with out an s on the end of the layername
for (File file : styleDir.listFiles()) {
if (file.getName().toLowerCase().startsWith(table.substring(0, table.length() - 2) + ".")) {
styleFile = file;
break;
}
}
}
if (styleFile != null) {
if (reader.existsStyle(table)) {
publisher.updateStyle(styleFile, table);
} else {
publisher.publishStyle(styleFile, table);
}
} else {
System.err.println("no style found for " + table);
}
}