0

I know how to use HttpGet so that I can execute a httpget to one php page to get the JSONArray after querying the database. Now my problem is that I should first send one string: username to the php page, and then this php page should use this string(username) to query in mysql and return the result as a JSONArray. Should I just use HttpPost to post the string to php and obtain the response?Or any other methods?

Russia Must Remove Putin
  • 374,368
  • 89
  • 403
  • 331
user3162215
  • 357
  • 1
  • 9

1 Answers1

1

You shouldn't use the POST http method (HttpPost) for this, POST is when the request causes a change in the server of some type. Querying a database to simply get some registers can be perfectly done using GET http method (HttpGet), pass the "user" value as a URL parameter and you should be done.

emerino
  • 1,100
  • 11
  • 17
  • Well, in fact, I assumed that HttpPost can help the client send parameter to the server and obtain the response, while HttpGet can only visit the server and obtain the response without passing parameter...And then I searched the Internet about the usage of HttpGet and found that using URL+"?"+parameter can help pass that parameter to the server.. – user3162215 Sep 30 '14 at 04:13