Hi there,
We faced a similar issue in one of our project which uses Jackson to marshall/unmarshall HTTP payloads. It did not specify content-negotiation headers so that it assumed that JSON was the default content type. After we added azure-storage-blob, it switched to XML. This is due to the jackson-dataformat-xml dependency that is pulled with azure-storage-blob.
We tried to exclude jackson-dataformat-xml from the project and build the client with Accept: application/json header option :
final HttpClientOptions clientOptions = new HttpClientOptions() //
.setHeaders(
Arrays.asList(new Header(HttpHeaderName.ACCEPT.getCaseSensitiveName(), "application/json")));
this.blobServiceClient = new BlobServiceClientBuilder() //
.connectionString(connectionString) //
.clientOptions(clientOptions) //
.buildClient();
Unfortunately this had no effect on the content-type returned by Azure Blob API which was still XML.
This actually described in the API documentation (c.f. https://learn.microsoft.com/en-us/rest/api/storageservices/list-blobs?tabs=microsoft-entra-id#response-headers)
@KarishmaTiwari-MSFT would it be possible to fix this so that the Accept header is used ?
Thank you