Server Connect Response - forcing blank body

Anyone got any ideas ?

IS the source code available so I can modify it myself ?

Try a response step with 200 and {{null}} in the value part.

Hi Sid,

That unfortunately also return null.

It looks like it’s been naively hard-wired in place of a blank. I suspect it requires a code change in the lib. Is this code available anywhere- happy to mod it myself …

Thanks for your feedback

Damn. I was hoping that would not translate itself to string.
Patrick will reply soon with a solution I hope… He’s been tagged.

1 Like

An empty string should work, you could use and expression like {{''}}. I will check the server connect action later on why it is not an empty string when you just leave the text field empty.

That doesn’t work. The SC code appears to be explicitly pushing null whatever a blank state is evident

As a workaround open you SC file and add a data key-value pair with an empty string.

{
        "name": "",
        "module": "core",
        "action": "response",
        "options": {
          "status": 200,
          "data": ""
        }
}

That should give you an empty body.

image

But if you want to beat the UI and do what I call a pro move just do this so you don’t have to touch the code of the SC.

image

image

image

And you will also get an empty payload.

image

Hi Jon,

That gives me “” - which also returns an error. I’m looking for a n empty primitive.

I will try your pro move now !!

It won’t work either then. It will give you an empty string also :frowning:

The pro move forces a null

Try with {{{}}}and {{[]}} as code values for the empty variable

That will send and empty object or an empty array. Maybe the API will consume that.

image

image

It’s not playing nicely…gives me the literal {}

I’m out of ideas now :slight_smile:

So now we can only wait for the team to add a checkbox in the UI response action Send empty payload and the appropriate logic in the core files.

1 Like

What server model are you using (Node,ASP,PHP)?

I’m using Node Patrick

Change the action file directly, add a contentType as property. The action defaults to json content type.

{
  "name": "",
  "module": "core",
  "action": "response",
  "options": {
    "status": 200,
    "contentType": "text/plain",
    "data": ""
  }
}

Thanks Patrick (and JonL),
Seems so bloody obvious really - had I known you could override the content-type.

Is there any developer-level documentation that you guys ever share? It would really help drive the product development knowing you could override/extend the codebase for the greater good.

Go raibh maith agat
John