1

I've seen many links of how to GET a response code, but is there a way, within the webscript of the Google Sheet, to SET a response code if a condition fails? e.g.

if(webscriptSharedToken != AUTH_TOKEN) {
    return setStatusCode(401); 
}

The idea would be to use this returned error code to prevent certain functions within the application I'm creating.

1 Answer 1

1

If you are making a request to a Google API, that is you call a server side method - you will obtain a HTTP Response coming from the server side - you cannot manipulate this response on the client side.

Sign up to request clarification or add additional context in comments.

4 Comments

Would there be any way to return something similar? A string or something.
What exactly do you want to do, which language are you using and to where do you want to return a response? To the browser window?
I am creating a Flutter app (therefore Dart language), and using the Google Sheet webscript to read/write data to/from the Google sheet. I want to return SOMETHING (string/response/true/false) back to the Flutter app in order to allow or deny certain app functions.
I assume you are calling a function within which data is read / written. You can implement a return value into your function. You can assign the response code you obtain from your request to a variable and use it as your return value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.