This is my boto3 command for getting the object with a specific key from an S3 bucket:
resp = s3client.get_object(Bucket=\'<>-<>\', Key=\'MzA1MjY1Nzkz
Another possible issue that I came across that was causing a line separator in my url for an object was that in one of AWS documentation for getting the key of an object shows this code as an example to get the key of an object.
foreach ($results as $result) {
foreach ($result['Contents'] as $object) {
echo $object['Key'] . PHP_EOL;
}
}
The problem is the PHP_EOL at the end. Just remove it and the line separator goes away.
$object['Key'] . PHP_EOL; --> $object['Key'];