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

How to set metadata such as Content-Type: gzip for media upload? #31

Open
burcugen opened this issue Oct 27, 2020 · 1 comment
Open
Labels
question Further information is requested

Comments

@burcugen
Copy link

burcugen commented Oct 27, 2020

I'm using createSimpleUpload method for uploading a gzipped png file.

I tried both sending queryParamaters array like:

["Content-Encoding" : "gzip"]

And also tried to send Content Encoding under MediaType:

mediaType: MediaType(type: "image", subType: "png", parameters: ["Content-Encoding" : "gzip"])

Both did failed.

I expected result as following. I think It needs to be set to httpHeaders, How can I pass Content-Encoding as metadata of object?

Screen Shot 2020-10-27 at 15 45 13

@burcugen
Copy link
Author

burcugen commented Oct 27, 2020

Update: After passing headerParameters: [String: String]? to createSimpleUpload.

        var headers: HTTPHeaders = [HTTPHeaderName.contentType.description: mediaType.description]
        if let headerParameters = headerParameters{
            for (key,value) in headerParameters{
                headers.add(name: key, value: value)
            }
        }

Is there any method that I can use? Thanks in advance.

@nathanfallet nathanfallet added the question Further information is requested label Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants