暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ValuesController.vb 717B

12345678910111213141516171819202122232425262728293031
  1. Imports System.Net
  2. Imports System.Web.Http
  3. Public Class ValuesController
  4. Inherits ApiController
  5. ' GET api/<controller>
  6. Public Function GetValues() As IEnumerable(Of String)
  7. Return New String() {"value1", "value2"}
  8. End Function
  9. ' GET api/<controller>/5
  10. Public Function GetValue(ByVal id As Integer) As String
  11. Return "value"
  12. End Function
  13. ' POST api/<controller>
  14. Public Sub PostValue(<FromBody()> ByVal value As String)
  15. End Sub
  16. ' PUT api/<controller>/5
  17. Public Sub PutValue(ByVal id As Integer, <FromBody()> ByVal value As String)
  18. End Sub
  19. ' DELETE api/<controller>/5
  20. Public Sub DeleteValue(ByVal id As Integer)
  21. End Sub
  22. End Class