Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix body params format #245

Merged
merged 1 commit into from
Jun 18, 2021
Merged

Fix body params format #245

merged 1 commit into from
Jun 18, 2021

Conversation

urbsny
Copy link
Contributor

@urbsny urbsny commented Jun 18, 2021

Hi, thank you for such a fantastic library.
I encountered #240 issue.

tryitout-3.0.2.js is checking hasFiles attribute is "0".

    if (form.dataset.hasfiles === "0") {
        body = {};
        setter = (name, value) => _.set(body, name, value);
    } else {
        body = new FormData();
        setter = (name, value) => body.append(name, value);
    }

But generated html has not "0" or "1"

<form id="form-POSTapi-v1-login" data-method="POST" data-path="api/v1/login" data-authed="0" data-hasfiles="" data-headers="{&quot;Content-Type&quot;:&quot;application\/json&quot;,&quot;Accept&quot;:&quot;application\/json&quot;}" onsubmit="event.preventDefault(); executeTryOut('POSTapi-v1-login', this);">

Hi, I encountered #240 issue and fix it.
fix #240

```
    if (form.dataset.hasfiles === "0") {
        body = {};
        setter = (name, value) => _.set(body, name, value);
    } else {
        body = new FormData();
        setter = (name, value) => body.append(name, value);
    }
```
@shalvah
Copy link
Contributor

shalvah commented Jun 18, 2021

Ah, thank you.

@shalvah shalvah merged commit c2e6fd4 into knuckleswtf:master Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants