Http request on local server

hi i want to send some web request to my homemade ir controller. there are two types of http request that my hub requires one being json and other being simple request. sorry i am not familiar with these url and these types but here are the two url which i want to send on my local network . the links works fine when i enter them into the url section of my browser but these are not working using the http binding. please help.

Switch saitv_on_off "TV" <television> ["Switchable"] { http=">[ON:PUT:http://192.168.0.16:1234/msg?code=A90:SONY:12&pulse=2&repeat=1&pass=4361&out=3] >[OFF:PUT:http://192.168.0.16:1234/msg?code=A90:SONY:12&pulse=2&repeat=1&pass=4361&out=3]" }

json

192.168.0.16:1234/json?plain=[{"type":"raw","data":[4350,4300, 550,1550, 550,500, 550,1550, 550,1550, 550,500, 600,450, 600,1550, 550,500, 550,500, 550,1550, 550,500, 550,500, 550,1550, 550,1550, 600,450, 600,1550, 550,500, 550,1550, 550,1550, 550,1550, 550,1550, 550,500, 600,1500, 600,1550, 550,1550, 550,500, 550,500, 550,500, 550,500, 550,1550, 550,500, 550,500, 600,1500, 600,1550, 550,1550, 550,500, 550,500, 550,500, 550,500, 550,500, 550,500, 550,500, 550,500, 600,1500, 600,1550, 550,1550, 550,1550, 550,1550, 550],"khz":38,"repeat":1}]&pass=4361

Well, first, your browser isn’t sending a PUT. It’s sending a GET.

Second, when trying to solve these problems, you need to get a debug log and review it. And if you don’t post the log, there’s not a lot we can do to help you.

It looks, however, as if your first item is ok, format-wise. The second is malformed, but I’m guessing that’s a copy-and-paste error.

hey thanks for the reply. i changed the method to GET and it’s still not working. i am very new to linux and openhab so i don’t know how to grab the log file . please tell me this linux command

There’s no linux command needed. Just look for the file openhab.log in the userdata/logs folder.
This will contain basic logging.

To enhance it, you need to go to the Karaf console and set the log level to DEBUG for the http binding:

openhab> log:set DEBUG org.openhab.binding.http

Then retry running your commands in OH and check the log.

i m on windows. how to do it via putty

If OH is not running on your windows box, then do it the same way you do everything else via putty.

If OH is running on your windows box, then you don’t need putty.

i am asking about the karaf console because in the documentation they say that can be only accessed from the machine on which it was installed. mine’s on my raspberry pi. please tell me how to open karaf console from putty.

update i have opened karaf console on all the ports. now my question is how to open the karaf console from putty as it requires a different port and i don’t know to change that in putty.

update i was able to ssh into the karaf console using bash on windows but on entering
log:set DEBUG org.openhab.binding.http

nothing happens. is that suppose to do that?
there was no error return

Yep, that’s how it works. If you do a get, it’ll tell you the new state:

log:get org.openhab.binding.http

now what do i have to do

Use your items as you expect them to work and see what output you get in the log.

update**

i just found out that the http binding is working as i used some link to trigger an ifttt event. that works perfectly.
i guess there is some problem sending web request to my local server. that’s weird!!