January 04, 2022, 08:20:17 am *
Welcome, Guest. Please login or register.
News:
 
   Forum Home   Search Login Register OBiTALK  
Pages: [1]
  Print  
Author Topic: Scripting Obi110  (Read 2545 times)
ukuser
Jr. Member
**
Posts: 23


« on: May 13, 2013, 08:48:28 am »

I want to change
Physical Interfaces >LINE Port > InboundCallRoute
on my Obi110 from a shell script (under Linux).
If I enter this url:
http://admin:admin@obihai/result.html?fecc8d44={12345:},{ph}
in a browser (Firefox) it works fine.

If I try the same using wget (or curl for that matter) eg :
wget 'http://admin:admin@obihai/result.html?fecc8d44={123456:},{ph}'
it changes InboundCallRoute alright but it's urlencoded and looks like this:
%7B123456:%7D,%7Bph%7D
which isn't going to work!
Using wget --post-data option does exactly the same thing.
Anyone got any thoughts please?
Logged
corporate_gadfly
Jr. Member
**
Posts: 67


« Reply #1 on: May 13, 2013, 11:56:51 am »

Shot in the dark, but have you tried cURL with the -F flag?

From wget man page (wget only supports application/x-www-form-urlencoded):
Code:
      --post-data=string
       --post-file=file
           Use POST as the method for all HTTP requests and send the specified data in the request body.
           --post-data sends string as data, whereas --post-file sends the contents of file.  Other than
           that, they work in exactly the same way. In particular, they both expect content of the form
           "key1=value1&key2=value2", with percent-encoding for special characters; the only difference is
           that one expects its content as a command-line parameter and the other accepts its content from a
           file. In particular, --post-file is not for transmitting files as form attachments: those must
           appear as "key=value" data (with appropriate percent-coding) just like everything else. Wget does
           not currently support "multipart/form-data" for transmitting POST data; only
           "application/x-www-form-urlencoded". Only one of --post-data and --post-file should be specified.
« Last Edit: May 13, 2013, 12:12:13 pm by corporate_gadfly » Logged
ukuser
Jr. Member
**
Posts: 23


« Reply #2 on: May 13, 2013, 05:05:24 pm »

Thanks for those suggestions corporate_gadfly !

but have you tried cURL with the -F flag?
No I hadn't - but I have now (as well as a few other data flags). Sadly, no difference.

wget only supports application/x-www-form-urlencoded
Indeed so and, according to Tamper Data, that is the way Firefox sends the data so I thought it should be OK.

The really annoying thing is wget works fine so long as there are no characters that need to be urlencoded in the data so
Code:
wget 'http://admin:admin@obihai/result.html?fecc8d44=ph'
works fine but
Code:
wget 'http://admin:admin@obihai/result.html?fecc8d44={ph}'

or (clutching at straws)
Code:
wget 'http://admin:admin@obihai/result.html?fecc8d44=%7Bph%7D'
don't.
I'm sure I'm missing something obvious!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Advertisement
Advertisement