Yii Framework Forum: Issues With Using Restfulyii Extension And Android - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Issues With Using Restfulyii Extension And Android Header variables and authentication Rate Topic: -----

#1 User is offline   DrownFish 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 05-April 14

Posted 05 April 2014 - 01:51 AM

When I using the curl example in the Extension page, I found that my server doesn't read the variable name "X_REST_USERNAME" and "X_REST_PASSWORD", later on I found that all header server received, if the variable name has "_", server will ignore it. if the variable name in lower case, server will automatically append it with the prefix "HTTP_" and make it upper case. for example, if in header, you have a variable called "username", then on the server side script, in my case is PHP, I will get the data with $_SERVER['HTTP_USERNAME"]. I am not sure whether is my server(apache + php) caused the issue or not. Thanks if anyone can explain it.

Now I try to use it as an standard RESTful API with android. Here is my app design:
app will send the API key in the header to identify itself the request is from the app.
if the user is not login when request some data that required user's login, then ask for login.
after login, an user token will be generated for the user, so if the data required user's login, the sandard request will be api key + user token.

unfortunately the example in the RestfulYii extension is based on the javascript / jquery, anyone can provide the detail of how it suppose to work with android

Many thanks!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users