I'm trying to update a single contact in my addressbook by specifying the id of the contact and the VCF format (http://localhost/home/user/contacts?...th=nsc&fmt=vcf). The server accepts the contact (no errors), but instead of overwriting the contact it adds a new contact. Has anyone updated a contact successfully before?

It doesnt have to be in VCF format. Any format will do.

The following Java code was used to save a contact:

public void saveItem( int itemID, String vcf ) throws Exception{
String server = "localhost"
URL url = new URL( server + "/home/laukvik/contacts?id=" + itemID + "&auth=nsc&fmt=vcf" );
HttpURLConnection uc = (HttpURLConnection) url.openConnection();
uc.setDoInput( true );
uc.setDoOutput( true );
uc.setRequestProperty ("Authorization", "Basic " + encoding);
uc.setRequestProperty( "Content-Type", "text/x-vcard" );
uc.setRequestProperty( "Content-Length", vcf.length() + "" );
uc.setUseCaches( false );
OutputStream wr = uc.getOutputStream();
wr.write( vcf.getBytes() );