Community discussions

MikroTik App
 
wathoom
just joined
Topic Author
Posts: 5
Joined: Sat Aug 18, 2018 10:13 pm

How to use fetch http-header-field since 6.43.12

Thu Feb 21, 2019 10:17 pm

Hi,

can someone give example how to use multiple header fields along with content-type with 6.43.12 and 6.44rc1?

Tnx,
W
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26385
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: How to use fetch http-header-field since 6.43.12  [SOLVED]

Fri Feb 22, 2019 2:04 pm

you can now specify many headers, separated by comma:

http-header-field=h1:fff,h2:yyy
 
wathoom
just joined
Topic Author
Posts: 5
Joined: Sat Aug 18, 2018 10:13 pm

Re: How to use fetch http-header-field since 6.43.12

Fri Feb 22, 2019 5:17 pm

So for some services that require authentication to push some data it would look something like this:
http-header-field=Content-Type:application/json,X-Auth-Token: <token_id>

Is this correct? Does it require "" for contents under http-header-type? I'm pretty sure I tried this yesterday but got error on execution (Expected end of line something)
I'll test this again today and let you know.
 
wathoom
just joined
Topic Author
Posts: 5
Joined: Sat Aug 18, 2018 10:13 pm

Re: How to use fetch http-header-field since 6.43.12

Fri Feb 22, 2019 7:47 pm

so to answer my own question it doesn't require headers to be enclosed into quotations. Just no spaces.
 
manojlovicl
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Mon Aug 18, 2014 11:48 pm

Re: How to use fetch http-header-field since 6.43.12

Sat Jun 01, 2019 1:00 am

you can now specify many headers, separated by comma:

http-header-field=h1:fff,h2:yyy
Hi! Does anyone know how you can add a header that has a space inside? For example: http-header-field=Authorization:Basic test123

Thank you!
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: How to use fetch http-header-field since 6.43.12

Sat Jun 01, 2019 8:51 am

http-header-field="Header1: Value1,Authorization: Basic dXNlcjpwYXNz"

But for basic authentication you can also use:

user=user password=pass
 
manojlovicl
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Mon Aug 18, 2014 11:48 pm

Re: How to use fetch http-header-field since 6.43.12

Sat Jun 01, 2019 9:52 am

http-header-field="Header1: Value1,Authorization: Basic dXNlcjpwYXNz"

But for basic authentication you can also use:

user=user password=pass
Hi!

I managed to do it: http-header-field="content-type:application/json,Authorization:Basic SomeString1234" and it works! :) Thank you!

Who is online

Users browsing this forum: GoogleOther [Bot] and 75 guests