Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Documentation for Rest Service object?

Hello.

Can you point me to an example, documentation or tell me how to to use the dropdown "object" in the Request parameters of a service.
I could find nothing on here on usage.

Thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Documentation for Rest Service object?

Hello!

If you need to send object, you can either add fields to the object and map them separately or return object from JS code in mapping.

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Documentation for Rest Service object?

Thanks.

I was more interested in when I create a service not when using it.
So I could specify a url that is delivered via a decryption function. That way I dont have to implement it when using the service later as its already setup.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Documentation for Rest Service object?

If URL is not changing, you can "specify a url that is delivered via a decryption function" and no request parameters are needed. But if it's changing use request parameters and substitution http://docs.appery.io/documentation/r...

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Documentation for Rest Service object?

Ok so when I create a service and want to use url generated by my decrypt function. How do I do this with a generic service please??

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Documentation for Rest Service object?

On the link you sent. Under "Basic authentication" heading.
Is that the method your referring too?
That refers to when the service is added to a page though.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Documentation for Rest Service object?

Not sure I understand what do you mean on "How do I do this with a generic service please"? Could you clarify what do you have at the moment and what are you trying to do?

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Documentation for Rest Service object?

Sure.
In the Context of Creating a New REST service in Appery.
The Settings tab.
"URL" I want this to be set by a value returned by my JS.
Not {myurl} which is specified in the Request Parameters unless it can be the result of a functions returned value.

Idea being no Hardcoded URL's for future use of this service.

Currently I'm using JS to do it but only when used on a page. Can this be done when creating the service though?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Documentation for Rest Service object?

Not {myurl} which is specified in the Request Parameters unless it can be the result of a functions returned valuesure there can be "result of a functions returned value" - add in request parameters mapping any functions (see the screenshot)
Image Besides that you can call service from JS code by passing service URL, for example this way prerestServiceName.execute({"url":"http://someurl.com/some/service"})/pre

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Documentation for Rest Service object?

Your using hard coded myurl in the request parameter thou....

I'm aware of the restServiceName.execute({"url":"http://someurl.com/some/service"}) and use that on some services.

I guess what I'm asking cant be done then..

So instead of using apperys invoke service in the select action. I will use javascript
var resutofDecrypt = function () {
my decryption stuff...
}
restServiceName.execute({"url":resutofDecrypt})

Thanks anyways

Return to “Issues”