1

How do I make an HTTP POST request with Famo.us framework?
I wish it's Utility library would have one along with their GET method, but there isn't. Do I need to implement my own one then? How did you guys solve it with your form data uploads? Do you use third party libraries? The info on Famo.us forms data handling is quite scarce - I couldn't find anything, except the InputSurface.

Alexander
  • 3,965
  • 1
  • 12
  • 16

1 Answers1

1

Famo.us has no helper functions for making POST requests. HTTP requests aren't within the scope of what it is trying to achieve. You can either:

  • use XMLHttpRequest directly
  • include a helper library which provides a wrapper for making POST requests
  • use some other ajax POST technique (such as submitting a form to an invisible iframe)
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Thank you, Quantin. Would you recommend a way to display an HTML form? Should I add the elements to DOM? – Alexander Jun 01 '14 at 23:41
  • If you want to display a form then you *have* to add it to the DOM. – Quentin Jun 02 '14 at 08:12
  • Yes, of course :) Sorry. The way I do it now is I render it in a `Surface` and then invoke xhr request upon submit. Am I on the right track? – Alexander Jun 02 '14 at 10:13