Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions storage/2020-08-04/table/tables/exists.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,21 @@ func (client Client) ExistsPreparer(ctx context.Context, accountName, tableName
"tableName": autorest.Encode("path", tableName),
}

headers := map[string]interface{}{
"x-ms-version": APIVersion,
"Accept": "application/json;odata=nometadata",
}

// NOTE: whilst the API documentation says that API Version is Optional
// apparently specifying it causes an "invalid content type" to always be returned
// as such we omit it here :shrug:

preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.AsContentType("application/xml"),
autorest.AsContentType("application/json"),
autorest.WithBaseURL(endpoints.GetTableEndpoint(client.BaseURI, accountName)),
autorest.WithPathParameters("/Tables('{tableName}')", pathParameters))
autorest.WithPathParameters("/Tables('{tableName}')", pathParameters),
autorest.WithHeaders(headers))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

Expand Down