75060

Unable to get Python to POST on html

Question:

I've been trying to get my python code to post. I have tried using the Postman Plugin to test the post method and I would get a 405 method error. I am planning to have the user post the information and have it displayed.

Currently if I press submit I would get a error loading page, changing the form to get results in the submit button working and returning to the previous page. If I change the handler to post the screen would instantly display '405 Method Not Allowed'. I've looked through the Google App Engine logs and there are no errors. Can someone help me with what I done wrong and advise me on how to the post method functioning? Thanks for the time.

Answer1:

You're getting '405 method not allowed' because the POST is going to the same url that served up the page, but the handler for that path (MainPage) does not have a post method.

That's the same diagnosis that you were given when you asked this question two hours earlier under a different user id.

Stepping back further to address the "what have I done wrong" question: It seems to me that you've gotten quite far along before discovering that what you have doesn't work. So far along that the example is cluttered with irrelevant code that's unrelated to the failure. That makes it harder for you for figure this out for yourself, and it makes it more difficult for people here to help you.

In this situation, you help yourself (and help others help you) by seeing how much code you can eliminate while still demonstrating the failure.

Recommend

  • Read a file in “chunks” using PHP
  • Leaflet z-index
  • auth.provider is not set to 'password' when user signs-in with email and password
  • How can I extend PHP DOMElement?
  • Android onKey w/ virtual keyboard
  • How do I Dispose a HttpResponseMessage in my Web Api Method?
  • Is playing sound in Javascript performance heavy?
  • How can the INSERT … ON CONFLICT (id) DO UPDATE… syntax be used with a sequence ID?
  • Detect when Facebook like button is clicked
  • Webgrid not refreshing after delete MVC
  • WPF - CanExecute dosn't fire when raising Commands from a UserControl
  • AJAX Html Editor Extender upload image appearing blank
  • Ionic 2 storage is not cleaning up on uninstall - Only for signed APK
  • preg_replace Double Spaces to tab (\\t) at the beginning of a line
  • Word Open XML Mail Merge
  • Android fill_parent issue
  • Insert into database using onclick function
  • Knitr HTML Loop - Some HTML output, some R output
  • Updated Ionic CLI but shows previous version (Windows)
  • Can a Chrome extension content script make an jQuery AJAX request for an html file that is itself a
  • jquery mobile loadPage not working
  • jQuery tmpl and DataLink beta
  • Properly structure and highlight a GtkPopoverMenu using PyGObject
  • Calling of Constructors in a Java
  • Traverse Array and Display in markup
  • Transpose CSV data with awk (pivot transformation)
  • Matrix multiplication with MKL
  • SQL merge duplicate rows and join values that are different
  • Proper way to use connect-multiparty with express.js?
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • C# - Getting references of reference
  • How to set the response of a form post action to a iframe source?
  • Hits per day in Google Big Query
  • Exception on Android 4.0 `android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode)`
  • File not found error Google Drive API
  • Append folder name and increment by 1 using batch script
  • Android Heatmap on canvas or ImageView
  • Converting MP3 duration time
  • Conditional In-Line CSS for IE and Others?