0

I'm putting together a form in which it is possible to perform a query which is informing the url fields return. The relationship of the tables is as follows:

 TB_USER> TB_PEOPLE> TB_PHONE

  I'm going through the following url structure for the fields that should return:

http://localhost?fields=ID,USERNAME,TB_PEOPLE.fields(FIRST, LAST, TB_PEOPLE.TB_PHONE.fields(PHONE)

Note that I am returning fields from related table stating "table name". Fields (fields from related table) that can be recursive.

But I am in doubt how could parse that string without losing the idea of ​​relationship.

Thank you.

Verner
  • 107
  • 2
  • 6

1 Answers1

1

I would advise to use the POST method instead of sending it in such a reconstituted url. It is more secure than showing all the structure of your database.

Damian S
  • 156
  • 1
  • 7
  • POST isn't more secure that GET. You would only be hidding the structure from the URL [Is either GET or POST more secure that the other](http://stackoverflow.com/questions/198462/is-either-get-or-post-more-secure-than-the-other) This is a query so it should be a GET – Alexandre Rondeau Oct 24 '13 at 17:45
  • Well, the idea came from the Facebook API (https://developers.facebook.com/docs/graph-api/), we are starting a project with RESTFUL and the idea was to create an application server that would return to simple queries dynamically without the need to develop methods specific to them. I could not get an idea of ​​how to structure the data, I thought I'd do a url.Split (',') but in some cases it might not know which table belongs particular field. – Verner Oct 24 '13 at 19:31