Logic Form to HTTP Request JSON issues (SOLVED)

I have a really simple form for an email newsletter sign up that needs to be sent to Movio via their third party API. It seems pretty boilerplate, but I’m having trouble getting anything sent.

(Movio JSON Schema)

I decided to try Logic to handle the task, but I’ve hit a brick wall getting this to work

(Logic Setup)

(Parse Fail)

The JSON never gets parsed, but passes the test with a 200. I’ve tested the JSON in JSONLint, and the only issue it seems to detect is that, at the "email": portion, it detects about two or three carriage lines between the provided email value and it’s ending quotation mark. I don’t know if this is how it’s being read when Webflow tries to parse it.

(JSONLint results)

Nothing actually gets sent to Movio when you send the form. It shows that it’s sent, but in the console log, I’m seeing errors. I imagine because the JSON doesn’t get parsed correctly.

Is there a fix to this, or do I need to look into another solution to get this to work right? Thanks in advance.

Preview Link: Webflow - Fantastic Fest 2023


i experienced a similar issue with the line break not well parsed.

you can see the details on this ticket: Logic external api call including variables that contains line-break

In my case i had the problem with the text areas that allow multiline, perhaps a quick solution for you may be to use a text field instead of a text area to collect the email.

I’m already using a text field, not text area. So that’s not the problem. But looking at your ticket, it sounds like this is a Webflow issue that may not get patched any time soon.

Update: I tried to do this with custom code, but I get CORS errors when I try that method. If Logic can’t compile my JSON properly, I need another method of implementing this functionality.

Got in touch with a Webflow representative and figured out the issue.

Apparently the “Content-Length” header was preventing anything from being sent specifically to this endpoint. I don’t know if it’s an issue with Webflow Logic or the third party, but it’s working fine now. Closing this as resolved.

What was it about your “Content-Length” header that prevented anything from being sent?

I added a content length header and made it 0 and it is still failing in real time but not the test.

Honestly, I don’t know why that was the issue. But we just didn’t use “Content-Length” at all, and it’s been working since.

Hi there

I have the same issue, what did you add? I tried Content-Length: 0 but that does not work