microsoft-azure-storage/src/com/microsoft/azure/storage/queue/QueueRequest.java
public static HttpURLConnection putMessage(final URI uri, final QueueRequestOptions queueOptions,
            final OperationContext opContext, final int visibilityTimeoutInSeconds, final int timeToLiveInSeconds)
            throws IOException, URISyntaxException, StorageException {

        final UriQueryBuilder builder = new UriQueryBuilder();

        if (visibilityTimeoutInSeconds != 0) {
            builder.add(VISIBILITY_TIMEOUT, Integer.toString(visibilityTimeoutInSeconds));
        }

        if (timeToLiveInSeconds != 0) {
            builder.add(MESSAGE_TTL, Integer.toString(timeToLiveInSeconds));
        }

        final HttpURLConnection request = BaseRequest.createURLConnection(uri, queueOptions, builder, opContext);

        request.setDoOutput(true);
        request.setRequestMethod(Constants.HTTP_POST);

        return request;
    }
public static HttpURLConnection putMessage(final URI uri, final QueueRequestOptions queueOptions,
            final OperationContext opContext, final int visibilityTimeoutInSeconds, final int timeToLiveInSeconds)
            throws IOException, URISyntaxException, StorageException {

        final UriQueryBuilder builder = new UriQueryBuilder();

        if (visibilityTimeoutInSeconds != 0) {
            builder.add(VISIBILITY_TIMEOUT, Integer.toString(visibilityTimeoutInSeconds));
        }

        if (timeToLiveInSeconds != 0) {
            builder.add(MESSAGE_TTL, Integer.toString(timeToLiveInSeconds));
        }

        final HttpURLConnection request = BaseRequest.createURLConnection(uri, queueOptions, builder, opContext);

        request.setDoOutput(true);
        request.setRequestMethod(Constants.HTTP_POST);

        return request;
    }
Constructs a web request to add a message to the back of the queue. Write the encoded message request body
generated with a call to QueueMessageSerializer#generateMessageRequestBody(String)} to the output
stream of the request. Sign the web request with the length of the encoded message request body.

@param uri
A <code>URI</code> object that specifies the absolute URI to
the queue.
@param queueOptions
A {@link QueueRequestOptions} 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 CloudQueueClient}.
@param opContext
An {@link OperationContext} object that represents the context
for the current operation. This object is used to track
requests to the storage service, and to provide additional
runtime information about the operation.
@param visibilityTimeoutInSeconds
Specifies the length of time for the message to be invisible
in seconds, starting when it is added to the queue. A value of
0 will make the message visible immediately. The value must be
greater than or equal to 0, and cannot be larger than 7 days.
The visibility timeout of a message cannot be set to a value
greater than the time-to-live time.
@param timeToLiveInSeconds
Specifies the time-to-live interval for the message, in
seconds. The maximum time-to-live allowed is 7 days. If this
parameter is 0, the default time-to-live of 7 days is used.
@return An <code>HttpURLConnection</code> configured for the specified
operation.

@throws IOException
@throws URISyntaxException
If the URI is not valid.
@throws StorageException
If a storage service error occurred during the operation.