# Failing SuperHTTP request because of missing ContentType

**URL:** https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672
**Category:** Remoting SDK
**Tags:** delphi
**Created:** [July 22, 2026, 1:55pm UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672 "2026-07-22T13:55:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![infokevercom](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/i/779978/32.png) [@infokevercom](https://talk.remobjects.com/u/infokevercom)
#### Post date: [July 22, 2026, 1:55pm UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/1 "2026-07-22T13:55:26Z")

</div>

Hello,

We’ve run into an issue in our Delphi FMX app. We use `TRONetSuperHTTPChannel` to connect to a Remoting SDK SuperHTTP server endpoint as part of our login process.

On Android, iOS and macOS the `ShHello` request fails for one of our endpoints: we get an HTML “Request Rejected” response from a Web Application Firewall. On Windows the same request succeeds.

The issue seems to be that `TRONetSuperHTTPChannel.DispatchHTTPRequest` never sets a `Content-Type` on the post. On Android/iOS/macOS the platform HTTP stack then defaults to `application/x-www-form-urlencoded`, which the WAF rejects for the binary SuperHTTP body. Windows (WinHTTP) sends no Content-Type in that case, and the WAF allows that to go through.

As temporary workaround I’ve subclassed `TRONetSuperHTTPChannel` and have my own version of DispatchHTTPRequest and it works but would be nice if this could be fixed.

Thank you in advance!

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 23, 2026, 6:50am UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/2 "2026-07-23T06:50:26Z")

</div>

Hi,

Will WAF accepts `application/octet-stream` value?

if yes, you can use

```auto
procedure TROBaseSuperHTTPChannel.DispatchHTTPRequest(aWaitingThread: Boolean; aRequest: TStream; out aResponse: TStream);
begin
  SetHeaders(aWaitingThread, id_ContentType, id_ContentType_application_octetstream); // <<< added

```

---

<div class="post-metadata">

### Author: ![infokevercom](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/i/779978/32.png) [@infokevercom](https://talk.remobjects.com/u/infokevercom)
#### Post date: [July 29, 2026, 1:49pm UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/3 "2026-07-29T13:49:49Z")

</div>

> [@EvgenyK](#):
>
> `SetHeaders(aWaitingThread, id_ContentType, id_ContentType_application_octetstream); // <<< added`

Thank you for your response. So `application/octet-stream`is accepted, but the `SetHeaders` call doesnt work. What worked for me is to set it like this:  
`l_request.SetHeaderValue(id_ContentType, id_ContentType_application_octetstream);`

But that is actually also not the only thing I see now.

There’s also this

```auto
procedure TROBaseSuperHTTPChannel.DispatchHTTPRequest(aWaitingThread: Boolean; aRequest: TStream; out aResponse: TStream);
begin
  {$IFDEF LOG}
  if not aWaitingThread then
    Log('===== DispatchHTTPRequest (' + TargetUrl + ')')
  else
    Log('===== DispatchHTTPRequest[WAITING] (' + TargetUrl + ')');
  {$ENDIF}
  if fAllowGzipEncoding and not aWaitingThread then begin
    if (aemGZIP in fServerAcceptEncodingModes) and
      fCanUseContentEncoding and not IsEncryptionUsed and
      (aRequest.Size >= fMinSizeForGzipEncoding) then begin
      DoEncodeStream(aRequest);
      SetHeaders(aWaitingThread, id_ContentEncoding, id_gzip);
    end
    else begin
      SetHeaders(aWaitingThread, id_ContentEncoding, '');
    end;
  end
  else begin
    SetHeaders(aWaitingThread, id_ContentEncoding, '');
  end;
end;

```

The 2 `SetHeaders(aWaitingThread, id_ContentEncoding, '');` calls are also contributing to the issue. In my subclass I’m skipping those. So skipping these 2 + the `l_request.SetHeaderValue` thing from before made it work for me.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 29, 2026, 2:10pm UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/4 "2026-07-29T14:10:02Z")

</div>

Hi,

hmm, I don’t see any special processing at:

```auto
procedure TNetHTTPRequest.SetCustomHeaderValue(const AName, Value: string);
begin
  FCustomHeaders.Value[AName] := Value;
end;

```

so

```auto
SetHeaders(aWaitingThread, id_ContentType, id_ContentType_application_octetstream);

```

and

```auto
SetHeaders(aWaitingThread, id_ContentEncoding, '');

```

should work as expected

unless they wrote empty value as `headername=`

---

<div class="post-metadata">

### Author: ![infokevercom](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/i/779978/32.png) [@infokevercom](https://talk.remobjects.com/u/infokevercom)
#### Post date: [July 30, 2026, 7:47am UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/5 "2026-07-30T07:47:52Z")

</div>

> unless they wrote empty value as `headername=`

Yeah this seems to be the case for the encoding issue:  
`SetHeaders(aWaitingThread, id_ContentEncoding, '');`

As for the content type I dont understand why, but `SetHeaders(aWaitingThread, id_ContentType, id_ContentType_application_octetstream);` does not work. I used Fiddler to verify, content type doesnt show up in the request headers if we use the `SetHeaders` call but does with `l_request.SetHeaderValue`.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 30, 2026, 11:31am UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/6 "2026-07-30T11:31:09Z")

</div>

Hi,

try this case:

- 

```auto
procedure TROBaseSuperHTTPChannel.DispatchHTTPRequest(aWaitingThread: Boolean; aRequest: TStream; out aResponse: TStream);
begin
  SetHeaders(aWaitingThread, id_ContentType, id_ContentType_application_octetstream); // <<< added

```

- 

```auto
procedure TRONetSuperHTTPChannel.SetHeaders(aWaitingThread: Boolean; const aName, aValue: string);
var
  l_client: THTTPClient;
begin
  if aWaitingThread then
    l_client := ClientWait
  else
    l_client := ClientRequest;

  if l_client.CustomHeaders[aName] <> aValue then
    l_client.CustomHeaders[aName] := aValue;
end;

```

as for me, it works as expected:

 ![](https://talk.remobjects.com/uploads/default/original/3X/5/8/58973f9081bacdbeeb0b5f5e3ab62ffaab135089.png)

---

<div class="post-metadata">

### Author: ![infokevercom](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/i/779978/32.png) [@infokevercom](https://talk.remobjects.com/u/infokevercom)
#### Post date: [July 30, 2026, 1:58pm UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/7 "2026-07-30T13:58:47Z")

</div>

My bad about the content type part, that is working now. I must have been calling in the wrong place before.

The Content-Encoding part with the empty strings is still an issue on Android though.

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [July 30, 2026, 2:01pm UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/8 "2026-07-30T14:01:21Z")

</div>

Hi,

if value isn’t set, it shouldn’t be added.  
at least on macos it works as expected:

```auto
  if l_client.CustomHeaders[aName] <> aValue then
    l_client.CustomHeaders[aName] := aValue;

```

---

<div class="post-metadata">

### Author: ![infokevercom](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/i/779978/32.png) [@infokevercom](https://talk.remobjects.com/u/infokevercom)
#### Post date: [July 30, 2026, 2:20pm UTC](https://talk.remobjects.com/t/failing-superhttp-request-because-of-missing-contenttype/33672/9 "2026-07-30T14:20:41Z")

</div>

Nevermind, you’re right. Thank you very much for your support!
