Skip to content

accept = 'application/json;odata=nometadata' gives results in XML; only get JSON with odata=verbose #5045

Description

@repton-infinity

e.g. in PowerShell, suppose $url is a suitable search API query URL.

If I do this, I get json results:

$headers = @{ accept = 'application/json;odata=verbose' }
Invoke-WebRequest -Uri $url -Headers $headers -UseDefaultCredentials

but if I do this, I get XML results:

$headers = @{ accept = 'application/json;odata=nometadata' }
Invoke-WebRequest -Uri $url -Headers $headers -UseDefaultCredentials


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:docs-commentCategory: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/devstatus:answeredAnswer to a question.type:questionQuestion... if answered, will be tagged as such.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions