title: REST API cannot be accessed by the C# Windows Form
body: <p>I have develop a REST API using Spring Boot and IntelliJ IDEA. That API is up and running. It is accessible by Postman &amp; it gives the relevant JSON response.</p>
  
  <p>Then I tried to access it from C# windows form application. I tried to add it as a web reference. But that button has been disabled.
  What is the problem with my code?</p>
  
  <pre><code>@RestController
  @RequestMapping("/students")
  public class StudentController {
  
  @Autowired
  private StudentService studentService;
  
  @RequestMapping(value="/hello")
  String home() {
      return "Hello World!";
  }
  
  @RequestMapping(value="getAllStudents",method = RequestMethod.GET)
  public Collection&lt;Student&gt; getAllStudents(){
      return studentService.getAllStudents();
  }
  
  @RequestMapping(value = "/{id}",method = RequestMethod.GET)
  public Student getStudentById(@PathVariable("id") int id)
  {
      return studentService.getStudentById(id);
  }
  
  
  @RequestMapping(value = "/{id}" , method = RequestMethod.DELETE)
  public void deleteStudentById(@PathVariable("id") int id)
  {
  studentService.removeStudentById(id);
  }
  </code></pre>
  
  <p>If I gives the URL as <em>localhost:8080/students/hello</em> the JSON response come to the visual studio. But it cannot be added as web reference.</p>
  
  <p><a href="https://i.stack.imgur.com/axSnJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/axSnJ.jpg" alt="enter image description here"></a></p>
  
  <p>What is the solution for this...?</p>