Einzelnen Beitrag anzeigen

mjustin

Registriert seit: 14. Apr 2008
3.004 Beiträge
 
Delphi 2009 Professional
 
#2

AW: TRESTClient - POST ohne Content-Type

  Alt 18. Jun 2019, 12:56
Nach RFC 7231 darf man den Content-Type leer lassen:

Zitat:
A sender that generates a message containing a payload body SHOULD
generate a Content-Type header field in that message unless the
intended media type of the enclosed representation is unknown to the
sender. If a Content-Type header field is not present, the recipient
MAY either assume a media type of "application/octet-stream"
([RFC2046], Section 4.5.1) or examine the data to determine its type.

Wenn der Server dagegen auf einem Content-Type besteht, ist das eigentlich nicht konform, sondern eine Eigenwilligkeit des Web Service.

Ich würde es als Bug in TRESTClient melden. Workarounds sind schwierig, falls Delphi keinen Interceptor (etwas zum Nachbearbeiten des Requests) bietet.
Man könnte den Delphi - Quelltext anpassen...
Michael Justin
habarisoft.com
  Mit Zitat antworten Zitat