Hi everybody,
I am interfacing a REST service that can either return XML or JSON which it will decide upon the value of the Accept Request Header.
I can set it, of course, like this:
LrHttp.get(url, {{field='Accept', value='application/json'}})
Lightroom (3.6 here) then sends this header:
GET /blaa HTTP/1.1
Host: whatever
Accept: */*, application/json
Now the service return HTTP/400 because of the '*/*' in the Accept-Header (reproducible with curl).
I have no control over the service as I am only a consumer, is there any chance I can tell LrHttp to send the Accept header without prepending '*/*'?
Thanks in advance,
Jörg
Several people have observed that LrHTTP doesn't provide flexibility in overriding headers. See this thread for a similar discussion and possible workarounds:
Thanks John,
so the only option is to go with luasocket or luacurl for example.
I'm not sure how you're thinking of using LuaSocket or LuaCURL. They are modules that need to be dynamically loaded into the application hosting Lua, which in this case is Lightroom. But LR doesn't allow for dynamic loading of Lua modules.