Community discussions

MikroTik App
 
adolfossl
just joined
Topic Author
Posts: 10
Joined: Mon Feb 05, 2018 11:53 am

Send value to URL

Sat Feb 05, 2022 11:17 pm

Hello everybody.

I have a script on linux:
wget --post-data "P14=1" 'http://192.168.88.199/rack1.html' --user=admin --password=admin

It sends P14=1 value to the url and works

In mikrotik I use:
/tool fetch url="http://192.168.88.199/rack1.html" http-method=post http-header-field="Content-Type: application" user=admin password=admin http-data="P14\"=\"1"
status: failed
failure: closing connection: <303 See Other "http://192.168.88.199/rack1.html"> 192.168.88.199:80 (5)

or

/tool fetch url="http://192.168.88.199/rack1.html" http-method=post http-data="P14\"=\"1" user=admin password=admin
status: failed
failure: closing connection: <303 See Other "http://192.168.88.199/rack1.html"> 192.168.88.199:80 (5)

The proxy inspector give this information when I do it on the web page :

POST /rack1.html HTTP/1.1
Host: 192.168.88.199
Content-Length: 5
Cache-Control: max-age=0
Authorization: Basic YWRtaW46YWRtaW4=
Upgrade-Insecure-Requests: 1
Origin: http://192.168.88.199
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.88.199/rack1.html
Accept-Encoding: gzip, deflate
Accept-Language: es-ES,es;q=0.9
Connection: close

P15=1


Any help for this issue?

Thanks a lot
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: Send value to URL  [SOLVED]

Sun Feb 06, 2022 12:47 am

You're sending P14"="1, not P14=1.
 
adolfossl
just joined
Topic Author
Posts: 10
Joined: Mon Feb 05, 2018 11:53 am

Re: Send value to URL

Sun Feb 06, 2022 12:00 pm

Oh yes.... The problem is resolved!!!!, this is the script:

/tool fetch url="http://192.168.88.199/rack1.html" http-method=post http-header-field="Content-Type: application" user=admin password=admin http-data="P15=0"

Thanks a lot of

Who is online

Users browsing this forum: marcelofares and 12 guests