microsoft-azure-storage/src/com/microsoft/azure/storage/table/TableRequest.java
public static HttpURLConnection insert(final URI rootUri, final TableRequestOptions tableOptions,
            final UriQueryBuilder queryBuilder, final OperationContext opContext, final String tableName,
            final String identity, final String eTag, final boolean echoContent, final TableUpdateType updateType)
            throws IOException, URISyntaxException, StorageException {
        HttpURLConnection retConnection = null;

        if (updateType == null) {
            retConnection = coreCreate(rootUri, tableOptions, queryBuilder, opContext, tableName, eTag,
                    null/* identity */, "POST");
            retConnection.setRequestProperty(TableConstants.HeaderConstants.PREFER,
                    echoContent ? TableConstants.HeaderConstants.RETURN_CONTENT
                            : TableConstants.HeaderConstants.RETURN_NO_CONTENT);
        }
        else if (updateType == TableUpdateType.MERGE) {
            retConnection = coreCreate(rootUri, tableOptions, queryBuilder, opContext, tableName, null/* ETAG */,
                    identity, "POST");

            retConnection.setRequestProperty(TableConstants.HeaderConstants.X_HTTP_METHOD, "MERGE");
        }
        else if (updateType == TableUpdateType.REPLACE) {
            retConnection = coreCreate(rootUri, tableOptions, queryBuilder, opContext, tableName, null/* ETAG */,
                    identity, "PUT");
        }

        retConnection.setDoOutput(true);

        return retConnection;
    }
public static HttpURLConnection insert(final URI rootUri, final TableRequestOptions tableOptions,
            final UriQueryBuilder queryBuilder, final OperationContext opContext, final String tableName,
            final String identity, final String eTag, final boolean echoContent, final TableUpdateType updateType)
            throws IOException, URISyntaxException, StorageException {
        HttpURLConnection retConnection = null;

        if (updateType == null) {
            retConnection = coreCreate(rootUri, tableOptions, queryBuilder, opContext, tableName, eTag,
                    null/* identity */, "POST");
            retConnection.setRequestProperty(TableConstants.HeaderConstants.PREFER,
                    echoContent ? TableConstants.HeaderConstants.RETURN_CONTENT
                            : TableConstants.HeaderConstants.RETURN_NO_CONTENT);
        }
        else if (updateType == TableUpdateType.MERGE) {
            retConnection = coreCreate(rootUri, tableOptions, queryBuilder, opContext, tableName, null/* ETAG */,
                    identity, "POST");

            retConnection.setRequestProperty(TableConstants.HeaderConstants.X_HTTP_METHOD, "MERGE");
        }
        else if (updateType == TableUpdateType.REPLACE) {
            retConnection = coreCreate(rootUri, tableOptions, queryBuilder, opContext, tableName, null/* ETAG */,
                    identity, "PUT");
        }

        retConnection.setDoOutput(true);

        return retConnection;
    }
public static HttpURLConnection insert ( final URI rootUri , final TableRequestOptions tableOptions , final UriQueryBuilder queryBuilder , final OperationContext opContext , final String tableName , final String identity , final String eTag , final boolean echoContent , final TableUpdateType updateType ) throws IOException , URISyntaxException , StorageException { HttpURLConnection retConnection = null ; if ( updateType == null ) { retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , eTag , null /* identity */ , "POST" ) ; retConnection . setRequestProperty ( TableConstants . HeaderConstants . PREFER , echoContent ? TableConstants . HeaderConstants . RETURN_CONTENT : TableConstants . HeaderConstants . RETURN_NO_CONTENT ) ; } else if ( updateType == TableUpdateType . MERGE ) { retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , null /* ETAG */ , identity , "POST" ) ; retConnection . setRequestProperty ( TableConstants . HeaderConstants . X_HTTP_METHOD , "MERGE" ) ; } else if ( updateType == TableUpdateType . REPLACE ) { retConnection = coreCreate ( rootUri , tableOptions , queryBuilder , opContext , tableName , null /* ETAG */ , identity , "PUT" ) ; } retConnection . setDoOutput ( true ) ; return retConnection ; }
Reserved for internal use. Constructs an <code>HttpURLConnection</code> to perform an insert operation.

@param rootUri
A <code>java.net.URI</code> containing an absolute URI to the resource.
@param tableOptions
A {@link TableRequestOptions} object that specifies execution options such as retry policy and timeout
settings for the operation. Specify <code>null</code> to use the request options specified on the
{@link CloudTableClient}.
@param queryBuilder
The {@link UriQueryBuilder} for the operation.
@param opContext
An {@link OperationContext} object for tracking the current operation. Specify <code>null</code> to
safely ignore operation context.
@param tableName
The name of the table.
@param identity
The identity of the entity. The resulting request will be formatted as /tableName(identity) if not
null or empty.
@param eTag
The etag of the entity, can be null for straight inserts.
@param updateType
The {@link TableUpdateType} type of update to be performed. Specify <code>null</code> for straight
inserts.
@return
An <code>HttpURLConnection</code> to use to perform the operation.

@throws IOException
if there is an error opening the connection.
@throws URISyntaxException
if the resource URI is invalid.
@throws StorageException
if a storage service error occurred during the operation.
Reserved for internal use . Constructs an <code > HttpURLConnection< / code > to perform an insert operation .