anchor.diff:                           is_binary(Inputs) ->
                                 Client:mapred_bucket(Inputs, Query)
                         end,
  +            RD1 = wrq:set_resp_header("Content-Type", "application/json", RD),
               case Results of
                   {ok, Result} ->
  -                    RD1 = wrq:set_resp_header("Content-Type", "application/json", RD),
                       {true, wrq:set_resp_body(mochijson2:encode(Result), RD1), State};
                   Error ->
                       error_logger:error_report(Error),
  -                    {{halt, 500}, send_error(Error, RD), State}
  +                    {{halt, 500}, send_error(Error, RD1), State}
               end
       end.
   
   %% Internal functions
   send_error(Error, RD)  ->
  -    RD1 = wrq:set_resp_header("Content-Type", "application/json", RD),
  -    wrq:set_resp_body(format_error(Error), RD1).
  +    wrq:set_resp_body(format_error(Error), RD).
   
   format_error({error, Message}=Error) when is_atom(Message);
                                       is_binary(Message),
  
positive.code:                         Client:mapred_bucket_stream(Inputs, Query, Me,
                                                      ?DEFAULT_TIMEOUT)
                  end,
              RD1 = wrq:set_resp_header("Content-Type", "application/json", RD),
              {true, wrq:set_resp_body({stream, stream_mapred_results(RD1, ReqId)}, RD1), State};
          Param when Param =:= "false";
                     Param =:= undefined ->
              Results = if is_list(Inputs) ->
  
negative.code: -define(INPUTS_TOKEN, <<"inputs">>).
  -define(DEFAULT_TIMEOUT, 30000).
  
  -record(state, {client, inputs, mrquery, boundary}).
  
  init(_) ->
      {ok, undefined}.
  