server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponseWrapper.java
public OHttpResponseWrapper writeRecords(final Object iRecords, final String iFetchPlan) throws IOException {
    response.writeRecords(iRecords, iFetchPlan);
    return this;
  }
public OHttpResponseWrapper writeRecords(final Object iRecords, final String iFetchPlan) throws IOException {
    response.writeRecords(iRecords, iFetchPlan);
    return this;
  }
Writes records as response specifying a fetch-plan to serialize nested records. The records are serialized in JSON format.

@param iRecords
List of records to serialize
@param iFetchPlan
Fetch plan to specify nested records
@return The object itself for fluent chained calls