Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

71
Views
URL no válida de Alamofire

Obtención de error al intentar obtener información. El servidor admite el idioma ruso en la URL.

Error:

[Resultado]: ERROR: URL no válida (url: " http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=сплин&api_key=bad5acca27008a09709ccb2c0258003b&format=json ")

Petición:

 Alamofire.request("http://ws.audioscrobbler.com/2.0/? method=artist.search&artist=\(nameOfArtist)&api_key=bad5acca27008a09709ccb2c0258003b&format=json") .responseObject { (response: DataResponse<SearchArtistAPIModel>) in //to get status code debugPrint(response) if let status = response.response?.statusCode { switch(status){ case 200...499: print("example success") default: print("error with response status: \(status)") } } if let artistName = response.result.value { guard let artistsArray = artistName.results?.artistmatches?.artist else { return } var names: [String] = [] for artists in artistsArray { guard let artistsName = artists.name else { return } names.append(artistsName) completion(names) } } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Codifique su URL y luego cree una solicitud.

 let urlString = "http://ws.audioscrobbler.com/2.0/?method=artist.search&artist=\(nameOfArtist)&api_key=bad5acca27008a09709ccb2c0258003b&format=json" if let encoded = urlString.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed),let url = URL(string: encoded) { Alamofire.request(url).validate().responseJSON { (json) in print(json) //Enter your code here } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!