Questions tagged [resty]

Resty is a small, convenient library to talk to RESTful services from Java. Resty focus is on simplicity and ease-of-use, often requiring only two lines of code to access RESTful web services.

Resty is a small, convenient library to talk to RESTful services from Java.

It’s surprisingly complex to do the simplest HTTP calls with the standard Java library. Resty hopes to change that.

Its focus is on simplicity and ease-of-use, often requiring only two lines of code to access RESTful web services.

Basic usage is very simple: Create a Resty instance, use authenticate method to add credentials, then call one of the content type specific methods. The idea is that the method name will convey the expected content type.

13 questions
2
votes
0 answers

Resty-GWT and HandlerExceptionResolver: How do I deal with special cases?

I'm using GWT and Resty for my web app. I need to treat two exceptions as special cases and pass additional information to the client. These previously were handled by the Resty calls onFailure() method, as follows: …
Brett Slocum
  • 358
  • 1
  • 5
  • 21
2
votes
2 answers

Please help me de-cipher this line of bash scripting code

What does this mean? h2t=$((exec 2>&-; (which lynx >/dev/null && echo lynx -stdin -dump) \ || which html2text || which cat) |tail -n 1) Ok, h2t=... means it's setting a variable. I thought double-parens were for arithmetic…
Cheeso
  • 180,104
  • 92
  • 446
  • 681
1
vote
1 answer

Pass custom parameters with the authorization request using lua-resty-openidc

I'm using lua-resty-openidc to configure NGINX as an OIDC RP with my Authorization Server. My requirement is to pass a value from the initial request coming to the Nginx (from the browser, let's say a query param), in the authorization code request…
sathya
  • 428
  • 4
  • 15
1
vote
1 answer

Unknown directive "lua_package_path" when trying to start nginx

I am getting this when trying to start my nginx service unknown directive "lua_package_path" Can someone please help me understand what it is looking for? I have both lua-resty-openidc and lua-resty-hmac installed but I just don't know what to…
1
vote
1 answer

Mocking methods in an existing lua file during Busted tests

I'm wanting to write unit tests for an existing lua file using Busted. I want to swap out some of the methods during the test, so that the file runs with the mocked/stubbed methods rather than the real ones (otherwise it will fail). Some of the…
Ryan
  • 65
  • 7
1
vote
1 answer

How to set header on get method - android rest api

I've used Rest api using resty.jar in my application i get from http://beders.github.io/Resty/Resty/Examples.html Here, get and post method are working well. But i don't know how to add header in get method. How to achieve this?
RVG
  • 3,430
  • 4
  • 33
  • 61
0
votes
1 answer

pulling table with redis on lua

I'm running LUA on Nginx. I decided to fetch some variables via Redis. I am using a table on lua. It is like this; local ip_blacklist = { "1.1.1.1", "1.1.1.2", } I'm printing on Nginx; 1.1.1.1 1.1.1.2 I want to keep the values here on Redis and…
0
votes
1 answer

How to generate password hash for kong?

I'm using kong in serverless mode and it seems that in this mode password has to show up as an hashcode. In this topic they say how to generate one using lua but I have no idea on how to execute this thing on my machine. Any idea or equivalent one?
Phate
  • 4,750
  • 10
  • 51
  • 98
0
votes
0 answers

Unable to resty.v2 POST call via cron tab

I'm creating a scheduler using Golang's crontab and resty.v2 to call a POST api(Dropbox file upload api). When I'm invoking the file upload method manually its working fine. But when the same method is invoked via the crontab scheduler its not…
Abhinab Kanrar
  • 1,506
  • 2
  • 19
  • 43
0
votes
1 answer

will use request_pipeline increases performance in resty (lua)

In lua resty https://github.com/pintsized/lua-resty-http, I saw we can use request_pipeline for requests. I am wandering whether this will increase the performance. While after reading the source code, I found the request_pipeline method is also…
Yongxin Zhang
  • 89
  • 1
  • 3
0
votes
0 answers

Cannot delete resource from android with resty lib

I am using Resty 0.3.2 on android I have used all the methods successful but i cannot use delete bequese of the folowing error in the beging I thought that was permission on manifest but all the other methods( post, put get ) are working fine. code…
0
votes
1 answer

Connection Error in Resty

I am trying to use Resty from behind my institution proxy. I came up wtih this exception Exception in thread "main" java.net.ConnectException: Connection refused: connect Can someone help me telling why I am getting this exception? Here's the…
AdityaTS
  • 89
  • 11
-1
votes
1 answer

HttpMock is not intercepting Resty call

I have a function that calls an external api that I want to mock out in the test. func ApiWrapper(...) (...) { client := resty.New() var r apiResponse apiPath := "..." // In the test will be http://localhost:{PORT}/path/to/endpoint _, e :=…
Dan
  • 1,742
  • 1
  • 15
  • 20