Config 2.2: JSON Types

To return JSON types, you need to define few extra fields:

"json":{
    "Content_type":"application/json; charset=UTF-8",
    "Short":"json",
    "Challenge":"challenge",
    "Logged":"logged",
    "Logout":"logout",
    "Failed":"failed",
    "Case":1
  }

where Challenge, Logged, Logout and Failed are mandatory. Their meaning are:

  • Challenge: if visitor has no valid login ticket, instead of redirecting to a login screen, Genelet returns you {“data”:”challenge”}
  • Logged: after a successful login, Genelet returns you {“data”:”logged”}
  • Logout: after a successful logout, Genelet returns you {“data”:”logout”}
  • Failed: if an error is found, Genelet returns you {“data”:”failed”}

Finally, Case=1 is for JSON only.