Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Accept application/xml in tRest error http 406

Hi there,

 

I try to get XML with my tRest component, so I set this :

0683p000009M7Gq.pngBut I have an HTTP 406 error.... I also tried to add Content-Type application/xml or Content-Type test/plain (because it's like this in postman) but it doesn't work... However it works perfectly in postman with just adding Accept : application/xml in the "Headers" part.

 

Can someone helps me with that ? 


Thanks

Labels (3)
1 Solution

Accepted Solutions
TRF
Creator III
Creator III

What if you replace Accept by Content-Type?

View solution in original post

8 Replies
fdenis
Creator III
Creator III

hi,
what is the body of server response?

If a server returns such an error status, the body of the message should contain the list of the available representations of the resources, allowing the user to choose among them.
TRF
Creator III
Creator III

What if you replace Accept by Content-Type?
Anonymous
Not applicable
Author

Démarrage du job test_conf_event a 11:58 12/09/2019.
[statistics] connecting to socket on port 3860
[statistics] connected
200||{"id":-4772057240064483897,"login":"agirard","username":"Alain Girard","system":null,"client":"STA"}
<!doctype html><html lang="fr"><head><title>État HTTP 406 – Inacceptable</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>État HTTP 406 – Inacceptable</h1><hr class="line" /><p><b>Type</b> Rapport d'état</p><p><b>description</b> La ressource identifiée par cette requête n'est capable de générer des réponses qu'avec des caractéristiques incompatible avec la directive "accept" présente dans l'entête de requête.</p><hr class="line" /><h3>Apache Tomcat/9.0.21</h3></body></html>|406
[statistics] disconnected

Job test_conf_event terminé à 11:58 12/09/2019. [Code sortie=0]

 

 

Sorry it's in french but it returns : The ressource identify by this request is not able to handle answers only with caracteritics incompatible with the "accept" directive in the headers of the request.

Anonymous
Not applicable
Author

I Already tried.. It doesn't work 

fdenis
Creator III
Creator III

did you try without Accept directive?
did you have access to Server log or Application.
can you check if server accept the Accept directive?
fdenis
Creator III
Creator III

you may try Accept-Language or Accept-Charset: utf-8
Anonymous
Not applicable
Author

As I said, it works perfectly in Postman with the Accept : "application/xml", when I do it without the Accept I get text in json format, but i want it in XML..

 

I also try your others solutions with charset and language, combine and not combine with the accept, it doesn't work...

 

 

fdenis
Creator III
Creator III

what about server Logs