Content negotiation using WebSharper

Akash

I'm investigating whether WebSharper can be used to build a ReSTful API that supports content negotiation. I was hoping that it would support something similar to the Web API model, whereby the controller returns a resource that is subsequently converted to the correct representation based on the request's accept header. However, it appears that the header info is only available to the Router, which maps the request to an Action, and then the Controller is responsible for converting the Action into some Content (i.e. a representation). This suggests that I would need a separate Action for each representation of the resource, which feels ugly.

Am I missing something here, or is WebSharper meant to be "MVC done right" and is not intended for this use case?

Akash

As expected, I was missing something. The details are here.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Content negotiation to return HTML

From Dev

PhalconPHP: content negotiation?

From Dev

Restlet Content Type Negotiation

From Dev

PhalconPHP: content negotiation?

From Dev

Websharper : Using LI tags

From Dev

Spring boot controller content negotiation

From Dev

Jersey - content negotiation for error handling

From Dev

Spring MVC Content Negotiation throwing ClassCastException

From Dev

SupportedMediaTypes not used when doing content negotiation

From Dev

Why not use content negotiation to return JSON object?

From Dev

How to Use Content Negotiation in Spring Data Rest?

From Dev

How to disable content negotiation for Spring Actuators?

From Dev

Content Negotiation when looking at different output formats

From Dev

Content negotiation for File Download In Web API

From Dev

Is there a simple way to solve content negotiation in Spring boot

From Dev

How to Use Content Negotiation in Spring Data Rest?

From Dev

Content negotiation not working with respond_to stanza

From Dev

What is performing Transparent Content Negotiation in Apache

From Dev

Does HTTP content negotiation respect media type parameters

From Dev

spring cloud config-server .properties content-negotiation failing

From Dev

Is there better approach to Accept Header based content negotiation in Spring API?

From Dev

Why would HTTP content negotiation be preferred to explicit parameters in an API scenario?

From Dev

Is HTTP content negotiation being used by browsers and servers in practice?

From Dev

How to add csv MimeType to spring content-negotiation?

From Dev

Display HTML page using Websharper without Visual Studio

From Dev

How to execute configuration code in a WebSharper SPA without using the JavaScript attribute

From Dev

Websharper, Sitelets and Forms

From Dev

JavaScript function signatures in WebSharper

From Dev

Highcharts renderer in websharper

Related Related

  1. 1

    Content negotiation to return HTML

  2. 2

    PhalconPHP: content negotiation?

  3. 3

    Restlet Content Type Negotiation

  4. 4

    PhalconPHP: content negotiation?

  5. 5

    Websharper : Using LI tags

  6. 6

    Spring boot controller content negotiation

  7. 7

    Jersey - content negotiation for error handling

  8. 8

    Spring MVC Content Negotiation throwing ClassCastException

  9. 9

    SupportedMediaTypes not used when doing content negotiation

  10. 10

    Why not use content negotiation to return JSON object?

  11. 11

    How to Use Content Negotiation in Spring Data Rest?

  12. 12

    How to disable content negotiation for Spring Actuators?

  13. 13

    Content Negotiation when looking at different output formats

  14. 14

    Content negotiation for File Download In Web API

  15. 15

    Is there a simple way to solve content negotiation in Spring boot

  16. 16

    How to Use Content Negotiation in Spring Data Rest?

  17. 17

    Content negotiation not working with respond_to stanza

  18. 18

    What is performing Transparent Content Negotiation in Apache

  19. 19

    Does HTTP content negotiation respect media type parameters

  20. 20

    spring cloud config-server .properties content-negotiation failing

  21. 21

    Is there better approach to Accept Header based content negotiation in Spring API?

  22. 22

    Why would HTTP content negotiation be preferred to explicit parameters in an API scenario?

  23. 23

    Is HTTP content negotiation being used by browsers and servers in practice?

  24. 24

    How to add csv MimeType to spring content-negotiation?

  25. 25

    Display HTML page using Websharper without Visual Studio

  26. 26

    How to execute configuration code in a WebSharper SPA without using the JavaScript attribute

  27. 27

    Websharper, Sitelets and Forms

  28. 28

    JavaScript function signatures in WebSharper

  29. 29

    Highcharts renderer in websharper

HotTag

Archive