News:

  • September 24, 2026, 02:38:23 PM

Login with username, password and session length

Author Topic: HTTPCMD  (Read 9371 times)

MarkTTU

  • Hero Member
  • *****
  • Posts: 293
    • SamJackson.com
HTTPCMD
« on: May 13, 2019, 06:34:26 PM »
Trying to make use of the new HTTPCMD to interact with an API on a remote server. I've managed to build my JSON string successfully (proved by copy/pasting the string from Do-more into Postman) and I seem to communicate with the remote server ok, but I can't actually get it to work. Error response from the remote server is:

Code: [Select]
HTTP/1.1 411 Length Required

Content-Type: text/html; charset=us-ascii..Server: Microsoft-HTTPAPI/2.0..Date: Mon, 13 May 2019 22:23:19 GMT..Connection: close..Content-Length: 344....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">..
<HTML>
<HEAD>
<TITLE>Length Required</TITLE>..
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
</HEAD>..
<BODY>
<h2>Length Required</h2>..
<hr>
<p>HTTP Error 411. The request must be chunked or have a content length.</p>..
</BODY>
</HTML>..

Looks to me like the BRX isn't sending the length of the request in the HTTP header, but I don't see any way to add that to the things that need to be sent. Am I missing something?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: HTTPCMD
« Reply #1 on: May 13, 2019, 07:54:04 PM »
"Content-Length:" only applies to the request body, which generally only relates to PUT or POST. When you specify a request body we do send the length.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

MarkTTU

  • Hero Member
  • *****
  • Posts: 293
    • SamJackson.com
Re: HTTPCMD
« Reply #2 on: May 13, 2019, 08:47:41 PM »
Hmm... I must be missing something then. This should be sending the content length, right?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: HTTPCMD
« Reply #3 on: May 13, 2019, 08:56:50 PM »
Hmm... I must be missing something then. This should be sending the content length, right?

I would think so, yes. I'll email you.

"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

MarkTTU

  • Hero Member
  • *****
  • Posts: 293
    • SamJackson.com
Re: HTTPCMD
« Reply #4 on: May 13, 2019, 09:13:36 PM »
Thanks Bob. I'll be on the lookout for your email.

For what it's worth I was able to get the API call to work by manually writing the content length and content-type headers. Oddly if I put the content type where it belongs in the instruction my API would fail because it didn't get the content type.