0

I am using Neo4j and ExtJS in my application.

One good thing is that both handle JSON with array structure.

Neo4j returns and ExtJS can consume JSON like this:

{
  columns: ["name", "age"],
  data: [
    ["Peter", 34],
    ["Mike", 52]
  ]
}

instead of:

[
  {"name": "Peter", "age" 34},
  {"name": "Mike", "age" 52},
]

However, from my application server's HTTP API I want people to be able to choose which one of these JSON structures to receive.

So they are both JSON which means the HTTP header should be "Accept": "application/json". But how should I allow them to pick either one of the structures? Should they set a header or a query param? What is best practice?

1
  • It's best if you use query parameter, since they are both JSON. Commented Jun 23, 2012 at 13:07

1 Answer 1

1

I think that a simple param in the request would be enough.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.