problems with redis via http

697 views
Skip to first unread message

Matthew Mason

unread,
Jun 19, 2013, 3:10:53 PM6/19/13
to redi...@googlegroups.com
I am very much aware that this might be a really stupid question/problem, but I cannot figure out what is going wrong. I have 2.6.13 installed and running. Everything seem fine when using redis-cli:

[root@n7-z01-0a2a0e73 ~]# /opt/redis/bin/redis-cli
redis 127.0.0.1:6379> set foo 7
OK
redis 127.0.0.1:6379> get foo
"7"

That makes me believe that at the very least redis is working. The problem is when I try to get or put anything via HTTP. For example, I was under the impression I could just do a GET on /foo and should get a 200 OK response returning "7". But I get this:
[root@n7-z01-0a2a0e73 ~]# telnet 127.0.0.1 6379
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
GET /foo
$-1

If I try a get using curl, I get some errors back, then it hangs:
[root@n7-z01-0a2a0e73 ~]# curl -D - http://localhost:6379/foo
-ERR wrong number of arguments for 'get' command
-ERR unknown command 'User-Agent:'
-ERR unknown command 'Host:'
-ERR unknown command 'Accept:'

I can get rid of the last three errors by sending blank headers, but GET just is not working. What am I missing?

I should point out that I have this installed on more than one box and it is doing the same thing on both. I also have an older redis install doing the same thing.

Any advice would be appreciated.

Marc Gravell

unread,
Jun 20, 2013, 4:10:29 AM6/20/13
to redi...@googlegroups.com
Redis is not a http server; there is no http API to redis - just raw TCP and commands. It will try to interpret (as you see) the http protocol (headers, etc) as redis commands.

Basically: don't use http here.

Marc




--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Regards,

Marc

Colin Vipurs

unread,
Jun 20, 2013, 4:33:22 AM6/20/13
to redi...@googlegroups.com
The OP might be thinking of webdis (http://webd.is/).  This puts a HTTP layer over redis and let you interact with it in the way being described.
Maybe she awoke to see the roommate's boyfriend swinging from the chandelier wearing a boar's head.

Something which you, I, and everyone else would call "Tuesday", of course.
Reply all
Reply to author
Forward
0 new messages