I am getting error as
Constructor not defined: [weather001.weatherresult].()
at the time of creating instance for wrapper class. below is the code.
public class weather001 {
public string city {set;get;}
public string result {set;get;}
public string nameofcity {set;get;}
public list<weatherresult> wccc{set;get;}
public weatherresult wc{set;get;}
public void makeGetCallout() {
Http http = new Http();
HttpRequest request = new HttpRequest();
String requestEndpoint = 'https://api.openweathermap.org/data/2.5/forecast';
requestEndpoint += '?q=' + city;
requestEndpoint += '&units=metric';
requestEndpoint += '&APPID=' + '21ea14e29fcf2a9f90a209e267f7847c';
request.setEndpoint(requestEndpoint );
request.setMethod('GET');
// The response is in JSON format.
HttpResponse response = http.send(request);
if (response.getStatusCode() == 200) {
result =response.getBody();
weatherresult wc = new weatherresult();
}
}
public class weatherresult{
public Integer id {get;set;}
public String main {get;set;}
public String description {get;set;}
public String icon {get;set;}
public weatherresult(Integer k,string m,string des,string ic){
id = k;
main = m;
description = des;
icon = ic;
}
}
}