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

AJAX Post data casted to string #6

Closed
kamilersz opened this issue Jun 11, 2016 · 2 comments
Closed

AJAX Post data casted to string #6

kamilersz opened this issue Jun 11, 2016 · 2 comments

Comments

@kamilersz
Copy link

I tried to send POST data to server using this code

` var thisVm = this;

    quasar.make.a.post.request({
      url: 'message/new',
      data: {
        title: thisVm.title,
        content: thisVm.content,
      },
      xhrFields: {
        withCredentials: false
      }
    })
    .done(function(jsonObject) {
      quasar.navigate.to.route('#/');
    })
    .fail(function(jqXHR, textStatus, errorThrown) {
      console.log('uh, oh... the request failed...', errorThrown);
    });

`

but the form data sent as string

erro

@kamilersz
Copy link
Author

If the data set as string, then the form data is sent correctly
data: 'title=' + thisVm.title + '&content=' + thisVm.content

@rstoenescu
Copy link
Member

When using an Object or Array as data for your POST request then the data is JSON stringified hence the "string" representation. If on the other hand your data is already a string, it will be sent as-is.

Will update the documentation website to include this.

wedog pushed a commit to wedog/quasar that referenced this issue Jan 2, 2018
…ing-CleanUpFlexBox

Performance optimization
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

No branches or pull requests

2 participants