I'm trying to query an NFS-e with the REST components in delphi XE7, in the queries of type Json I got normally, but when the return is of type XML it gives the error 406, I already tried to send the Accept and Content-Type in the header but also did not solve, someone has already gone through this situation? do I need to do some differentiated treatment when return is XML?
Follow the code:
RESTRequest.ResetToDefaults;
RESTClient.ResetToDefaults;
RESTResponse.ResetToDefaults;
RESTClient.BaseURL := 'https://nfps-e-hml.pmf.sc.gov.br/api/v1/consultas/notas/xml/126564/4554566';
RESTClient.Authenticator := nil;
RESTRequest.Method := TRESTRequestMethod.rmGET;
RESTRequest.Execute;
Memo1.Clear;
Memo1.Lines.Text := RESTResponse.Content;