Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom request headers #55

Open
Dacello opened this issue Oct 31, 2024 · 2 comments
Open

Support custom request headers #55

Dacello opened this issue Oct 31, 2024 · 2 comments

Comments

@Dacello
Copy link

Dacello commented Oct 31, 2024

Currently, it seems like request headers for REST API calls have headers hardcoded, e.g. here when calling put_blob

I would like to add additional headers, such as x-ms-blob-content-md5 which allows sending an MD5 hash for added verification.

Resolved: Additionally, get_blob returns simply {:ok, blob} but we need the response headers as well. In my case its because there is a Content-MD5 header that can be used to enforce upload uniqueness.
Just use Blob.head_blob

https://learn.microsoft.com/en-us/rest/api/storageservices/put-blob?tabs=microsoft-entra-id#request-headers-all-blob-types
https://learn.microsoft.com/en-us/rest/api/storageservices/get-blob?tabs=microsoft-entra-id#request-headers

@Dacello Dacello changed the title Support custom request headers in Azure REST API Requests Support custom request headers Oct 31, 2024
@Dacello Dacello changed the title Support custom request headers Support custom request & response headers Nov 4, 2024
@Dacello Dacello changed the title Support custom request & response headers Support custom request headers Nov 4, 2024
@Dacello
Copy link
Author

Dacello commented Nov 4, 2024

UPDATE: I just discovered Azurex.Blob.head_blob which will get me what I need when it comes to the Content-MD5 header. That said, it would still be nice to be able to pass custom headers when we send requests.

@Dacello
Copy link
Author

Dacello commented Nov 4, 2024

I have come to another realization: if we made the Azurex.Blob.blob_request function public, that would also allow for any necessary custom request headers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant