Site icon Dax Judy

CODE LIBRARY: Straight Up HTTP String Response in VB.NET

Response Grunge Text

Lots of C# code out there but need to return a basic string response in Visual Basic .NET?

Try this..

Dim response As HttpResponseMessage = Request.CreateResponse(HttpStatusCode.OK, “value”)
response.Content = New StringContent(THESTRINGVALUE, Encoding.Unicode)
response.Headers.CacheControl = New CacheControlHeaderValue()
response.Headers.CacheControl.MaxAge = TimeSpan.FromMinutes(1)
Return response 

Exit mobile version