2
I am trying to consult an NFS-e with the REST components in the XE7, in the queries of type Json I could normally, but when the return is of type XML it gives error 406, I tried to send the Accept and Content-Type in the header but also not solved, Has anyone been through this? need to do some differentiated treatment when the return is XML?
Follows 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;
Add an error print, 406 can be very generic by the fact of
RESTClient
be based on Indy.– Junior Moreira
I put all the return
– Antonio Raichaski