doPost(e) does not return parameters but doGet(e) does?

后端 未结 3 1003
难免孤独
难免孤独 2021-01-06 23:59

Nowhere on the internet is this specific problem or a fix for it mentioned, so here goes:

My app contains the following doGet() and doPost()

3条回答
  •  醉梦人生
    2021-01-07 00:46

    POST and GET works perfectly fine for me using the exact same code you posted. My guess is that you are not testing the POST correctly.

    Here is my published URL. The code behind is a copy/paste of your sample -

    https://script.google.com/macros/s/AKfycbzWZv9WUp7rUtOxZhhwuXPpuNXuvPGpiHyrcYrPeNLiusOWzazo/exec

    Test it from http://hurl.it (simple REST tester in a browser) and works without any problem.

    Request (make sure to check follow redirects) -

    request screenshot

    Response (response after the redirect for one time ContentService URL for both GET and POST)

    response screenshot

提交回复
热议问题