1.6.0

Migration to Response Builder

Starting with 1.6.0 the old SendAsync methods are marked deprecated. Unity will warn if the project uses the old methods. If the project needs to postpone the migration and silence the warnings, the define DISABLE_OBSOLETE_WARNING_OLD_RESPONSE_METHODS can be added to “Player Settings -> Platform -> Other Settings -> Scripting Define Symbols”.

Each obsolete warning lists how to convert the calls, additionally the table below lists the transformation:

OldNew
SendAsyncGetResponserequest.CreateResponse().Body(content).SendAsync()
SendAsyncErrorResponserequest.CreateResponse().StatusError().Body(content, contentType).SendAsync()
SendAsyncGetJsonResponserequest.CreateResponse().BodyJson(obj, contentType).SendAsync()
SendAsyncGetResponserequest.CreateResponse().Status(status).Body(content).Headers(headers).SendAsync()
SendAsyncGetResponserequest.CreateResponse().Status(status).Body(content).Headers(headers).SendAsync()
SendAsyncOkResponserequest.CreateResponse().SendAsync()
SendAsyncHeadResponserequest.CreateResponse().SendAsync()
SendAsyncOptionsResponserequest.CreateResponse().Header(HttpHeader.ALLOW, \“HEAD,GET,POST,PUT,DELETE,OPTIONS,TRACE\”).SendAsync()
SendAsyncTraceResponserequest.CreateResponse().Body(content, MimeType.MESSAGE_HTTP).SendAsync()
SendAsyncTraceResponserequest.CreateResponse().Body(content, MimeType.MESSAGE_HTTP).SendAsync()
SendAsyncDefaultInternalServerErrorrequest.CreateResponse().InternalServerError().SendAsync()
SendAsyncDefaultNotFoundrequest.CreateResponse().NotFound().SendAsync()
SendAsyncDefaultNotAuthenticatedrequest.CreateResponse().NotAuthenticated().SendAsync()

1.2.0

Test Coverage (1.2.0)

NameCoverage (%)Covered LinesCoverable Lines
RestServer.DefaultRequestHandlerImpl  68.4 %1319
RestServer.Endpoint100.0 %33
RestServer.EndpointCollection100.0 %8383
RestServer.Helper.HeaderBuilder100.0 %2626
RestServer.Helper.UnityNetHelper100.0 %66
RestServer.LowLevelHttpServer76.9 %1013
RestServer.LowLevelHttpSession77.7 %2836
RestServer.RestRequest88.4 %6978
RestServer.RestServer88.8 %4854
RestServer.SpecialHandlers100.0 %66
RestServer.ThreadingHelper100.0 %4949

Average: 90.9%

The missing methods to 100% are usually rare error handling code, like socket errors or other low level functionality.

Profile Marker (1.2.0)

Profile markers can be assigned when scheduling a workload via ThreadingHelper.Instance.ExecuteXXX methods like this

ThreadingHelper.Instance.ExecuteAsync(() => { 
	transform.position += new Vector3(0.001f, 0.001f, 0.001f); 
}, "Position Updates");

These can now be found inside the profiler

Screenshot of the profiler showing the waterfall graph

By default, the name of the execute method (e.g. ExecuteSync) is used as the profile marker name.