Mailinglist Archive: yast-devel (246 mails)

< Previous Next >
Re: [yast-devel] Re: [yast-commit] <rest-service> master : Use format instead of content type, as it seems to set the
  • From: Klaus Kaempf <kkaempf@xxxxxxx>
  • Date: Wed, 26 Aug 2009 13:23:54 +0200
  • Message-id: <20090826112354.GA7694@xxxxxxxxxxxxx>
* Duncan Mac-Vicar Prett <dmacvicar@xxxxxxx> [Aug 26. 2009 13:13]:
On Tuesday 25 August 2009 08:12:56 Klaus Kaempf wrote:

Hmm, this looks 'fishy' to me. Actually, both ways (@request.accept
and setting :format) should work. The (http-wise and restful) correct way
is setting the http 'accept' header to the list of mime types (yes, there
can be multiple) acceptable by the client. The server is then free to
choose one of them.

I just tried both (setting the content type header) manually and using the
API
(passing format to get call) and both do the same.

Good.


I don't have evidence that using format => foo adds only the extension. It
may
set the content-type.

It might do, if used outside of tests. Using it inside tests,
bypassing the dispatcher, might have different results, i.e. requiring
the :format value to be a string.


And when having the choice to alter a parameter manually or to use the API, I
think we should use the API.

Agreed. However, on the receiver side, the http header is authorative,
not an .xml or .json url extension.

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N├╝rnberg)

--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >