Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8385019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:33:43+00:00 2026-06-09T17:33:43+00:00

If I want to follow the practice of using a custom content type for

  • 0

If I want to follow the practice of using a custom content type for my REST API, am I supposed to define a single custom content type for my entire project or define custom content types for each resource representation (what is sent to/back from my REST API) used on my project?

That is, if I am building a “Bookstore” REST API where the services say are in the namespace com.mycompany.mybookstoreapp, do I create a single content type:

Content-Type: application/com.mycompany.mybookstoreapp+xml

Or do I create a content type for each type of data that can be posted/retreived via my Bookstore REST APIs?

Content-Type: application/com.mycompany.mybookstoreapp.user+xml
Content-Type: application/com.mycompany.mybookstoreapp.order+xml
Content-Type: application/com.mycompany.mybookstoreapp.book+xml
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:33:45+00:00Added an answer on June 9, 2026 at 5:33 pm

    Describing a content type for each data seems the safest solution. If you want to be HATEOAS compliant later for some reasons, it will be easier. In another hand, it doesn’t make much sense to have one content type for everything. The content type describes the type for a specific data.

    About versioning, you can add versioning to your API in three different ways. First, you can add the version number in your URIs, this is the easy way:

    /api/v1/users
    

    Or you can use your new content type:

    application/vnd.acme.user-v1+xml
    

    Or you can also use a qualifier in your Accept header, that way you don’t touch your content type:

    application/vnd.acme.user+xml;v=1
    

    It’s really up to you. The first solution is easy but less RESTful than the two other solutions. But those solutions require more smart clients.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to follow MVC for my current project, in which 7-8 UIViewController subclasses
I want to know that how to follow a page on Twitter using android
I just want to follow conventions and i need to know where do i
so i want to follow the mvc conventions but haven't really got the hang
I believe I have found a weird bug as follow: I want to delete
I want to make a Follow a button like Twitter Follow in JQuery, Json
I want to tail multiple files (and follow them) in CentOS, I've tried this:
I want to new a StringArray as follow: class Test { public: QString* str[];
I want to implement a functionality similar to Who to follow in twitter or
In a follow-up to this answer I want to ask if any of you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.