We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Now the swifth client assumes ObjectNames are plain for the response and only calls readLines().
The default value of swift is plain, but there are cases where format=json is used, and support for this case is needed.
format=json
How about change readJson() or readLines() depending on "Contect-Type" like below?
// ObjectNames returns a slice of names of objects in a given container. func (c *Connection) ObjectNames(ctx context.Context, container string, opts *ObjectsOpts) ([]string, error) { v, h := opts.parse() resp, _, err := c.storage(ctx, RequestOpts{ Container: container, Operation: "GET", Parameters: v, ErrorMap: ContainerErrorMap, Headers: h, }) if err != nil { return nil, err } if resp.Header.Get("Content-Type") == "application/json" { var objects []Object err := readJson(resp, &objects) var names []string for _, obj := range objects { names = append(names, obj.Name) } return names, err } else { return readLines(resp) } }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Now the swifth client assumes ObjectNames are plain for the response and only calls readLines().
The default value of swift is plain, but there are cases where
format=json
is used, and support for this case is needed.How about change readJson() or readLines() depending on "Contect-Type" like below?
The text was updated successfully, but these errors were encountered: