cancel
Showing results for 
Search instead for 
Did you mean: 

OData metadata - Breeze.js expects JSON

afordham
Participant
0 Kudos

Hi,

We are trying to use the Breeze javascript library to work with OData served by Gateway. 

We define our dataservice as OData, but when we do a call to metadataStore.FetchMetadata, the Accept header is set to application/json and so the service returns a 406.  If we post the same URL into the browser (or use Postman), the XML data is successfully returned, as the broswer's default Accept header contains application/xhtml+xml.

Does anyone know how to get round this?  We cannot find a way of getting Breeze to change the request's Accept header (particularly just for the metadata request) and Gateway does not seem to support JSON metadata yet.

Many thanks,

Andrew

Accepted Solutions (0)

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

Andrew,

As per the OData standard, Metadata will be only in XML. So you may be doing something wrong while using Breeze.

Ref: Overview | OData - The Protocol for REST APIs