'Flutter retrofit response in xml

Im using dio+retrofit to hit a GET request on a particular website. I receive response in xml and an error:

DioError [DioErrorType.other]: RedirectException: Redirect loop detected

I'd like to make it work and receive this xml response then parse it to json/my app model.

The response should be in xml because im trying to scrap a website.

Any help appreciated.



Solution 1:[1]

The solution was to decorate the http method causing error with

@DioResponseType(ResponseType.plain)

Here you can find a great article about xml parsing

https://medium.com/flutter-community/working-with-retrofit-and-xml-on-flutter-62faf9edfa3c

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 maxpill