private String getSigningString(String customer_id) {

		String stringToSign = post ? "POST\n" : "GET\n";
		String content_type = post ? "application/x-www-form-urlencoded\n" : "\n";

		stringToSign += content_type;

		if (ts_date) {

			stringToSign += "\n";
		}
		else {

			Date now = new Date();

			SimpleDateFormat rfc2616 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss ZZZZ", Locale.US);
			String date = rfc2616.format(now);
			addHeader("Date", date);

			stringToSign += date + "\n";
		}

		/*
		 * Create the CanonicalizedTsHeaders element. This entails: Converting
		 * header names to lowercase, Sorting the set by header name, Ensuring
		 * that each X-TS- header name appears just once, Unfolding long header
		 * values that span multiple lines, by replacing the folding white space
		 * (newline) with a single space, and Removing white space surrounding
		 * the colon that appears between each header name/value pair.
		 */
		Set<String> orderedKeys = ts_headers.keySet();

		for (String key : orderedKeys) {

			stringToSign += key.toLowerCase() + ":" + ts_headers.get(key) + "\n";
		}

		if (post) {

			stringToSign += body + "\n";
		}

		stringToSign += resource;

		return stringToSign;
	}