Skip to main content
Participant
February 15, 2012
Question

Accept: */* in LrHttp.get/post

  • February 15, 2012
  • 1 reply
  • 1446 views

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

This topic has been closed for replies.

1 reply

johnrellis
Legend
February 16, 2012

Several people have observed that LrHTTP doesn't provide flexibility in overriding headers.   See this thread for a similar discussion and possible workarounds:

http://forums.adobe.com/message/4168390#4168390

Participant
February 16, 2012

Thanks John,

so the only option is to go with luasocket or luacurl for example.

johnrellis
Legend
February 16, 2012

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.