Couchbase Eventing CURL not taking header value

Hi…
I am using CURL function in eventing. But, It seems It’s not reading my header value.
The below is the example:
var request = {
path: '/test,
header: [‘AppKey:something’],
body: { id : meta.id,
value : doc
}
};
var response = curl(‘POST’, updateData, request);

I am executing above curl. It’s able hit URL but returning error because of missing header.

Appreciate your help.
Thanks,

Hi Viren,

Make sure you close your strings e.g. for the path: and follow the syntax in the spec correctly.

The following should get you going and pass your custom header.

var request = {
    path: '/test',
    headers: {
        'AppKey': 'something'
    },
    body: {
        id : meta.id,
        value : doc
    }
};
var response = curl('POST', updateData, request);

As far as the syntax is concerned refer to https://github.com/couchbase/eventing/blob/master/docs/specification-65.pdf and model your headers: block after either params: or body:

Thanks… got it. @jon.strabala