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

method request #905

Closed
Closed

Conversation

leonnleite
Copy link

Add method option and param option

let count = 0;
...
method: 'POST', 
params: function() { 
   return {foo: 'bar', baz: 'qux', count: ++count}; 
}
...

params could be:

let foo = 'bar';
params: {bar}

params: {foo: 'bar'}

params: document.getElementById('formSection')

params: 'foo=bar&baz=qux'

params: function() {...} 

params: () => {...} 

the XMLHttpRequest replaced to fetch

@desandro
Copy link
Member

Infinite Scroll v4 has been released. Infinite Scroll v4 adds a new option, fetchOptions, which allows you to set method, headers, CORS mode, and other options for the fetch request

fetchOptions: {
  mode: 'cors',
  cache: 'no-cache',
  credentials: 'same-origin',
  headers: {
    'X-Session-Id': '33vscths658h7996d324rqft1s',
  },
},

Thank you for your original contribution. While I did not merge it in, your effort did help me decide to support the feature.

@desandro desandro closed this Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants