REST-Adapter and custom content-types

Posted by Mike Fechner on 15-Jan-2015 05:07

Hi,

It's a nice feature that you can map any http header name/value pair to an input parameter of an AppServer method invoked via REST.

I'm trying to see if we can use the Accept header value to request specific versions of a dataset schema.

I am trying to allow consumers to do requests like this:

GET /customer/123 HTTP/1.1
Accept: application/vnd.company.myapp.customer-v3

Where vnd.company.myapp.customer-v3 would indicate version 3 of the customer. 

However in postman the REST adapter responds with http 406 (not acceptable).

Are custom content-types something we can make use of with the REST adapter. This seems to be common in the .NET world.

Alternative would be to use a custom http header (Version) which seem to work.

All Replies

Posted by Mike Fechner on 15-Jan-2015 05:08

OpenEdge Release 11.4, by the way

Posted by Michael Jacobs on 15-Jan-2015 05:26

Hi Mike,
The behavior you see is a result a limitation by the REST service to only 'accept' the type 'application/json...'.   It is a limitation we know about and are looking at.   Workarounds for passing other content types will be your friend for awhile.

Mike J.

[collapse]
From: Mike Fechner <bounce-mikefechner@community.progress.com>
Reply-To: "TU.OE.Development@community.progress.com" <TU.OE.Development@community.progress.com>
Date: Thursday, January 15, 2015 at 6:09 AM
To: "TU.OE.Development@community.progress.com" <TU.OE.Development@community.progress.com>
Subject: RE: [Technical Users - OE Development] REST-Adapter and custom content-types

Reply by Mike Fechner

OpenEdge Release 11.4, by the way

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Mike Fechner on 15-Jan-2015 05:32

Hi Mike. I was expecting this...

Thanks!

Von meinem Windows Phone gesendet

Von: Michael Jacobs
Gesendet: ‎15.‎01.‎2015 12:27
An: TU.OE.Development@community.progress.com
Betreff: Re: [Technical Users - OE Development] REST-Adapter and custom content-types

Reply by Michael Jacobs
Hi Mike,
The behavior you see is a result a limitation by the REST service to only 'accept' the type 'application/json...'.   It is a limitation we know about and are looking at.   Workarounds for passing other content types will be your friend for awhile.

Mike J.

[collapse]
From: Mike Fechner <bounce-mikefechner@community.progress.com>
Reply-To: "TU.OE.Development@community.progress.com" <TU.OE.Development@community.progress.com>
Date: Thursday, January 15, 2015 at 6:09 AM
To: "TU.OE.Development@community.progress.com" <TU.OE.Development@community.progress.com>
Subject: RE: [Technical Users - OE Development] REST-Adapter and custom content-types

Reply by Mike Fechner

OpenEdge Release 11.4, by the way

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Mike Fechner on 15-Jan-2015 06:11

Just tested that I can send

application/json,application/vnd.company.myapp.customer-v3

as the Accept header. This works with the REST Adapter and in the ABL Code I can still play around with the Interface version.

This thread is closed