views:

75

answers:

1

Hi All,

I am running Restful web service on 8182 port using restlet framework. I am trying to authenticate user to hit the service. i.g.

I have a query string like this http://localhost:8182/api/service/customers/?key="XXXXXXXXX"

My doubts are:

  1. How to get value of parameter key in Resource class/Application class, so i can authenticate user upon key through my custom database.

  2. I don't have any client code for my restful service, since i want to invoke all call from browser itself. so please tell me,how to send post data from browser itself. since i want to use post/put method to add new customer data.

I am using restlet framework 1.1.

Thanks in advance.

Karunjay Anand

A: 

You can use:

getRequest().getResourceRef().getQueryAsForm()

This will return a Form instance from which you can get the value of your query parameters (getFirstValue("key"), for example).

Bruno
Thanks Bruno, for helping me, almost i loosed my confidence , but he helped me lot.