Mobiledevices: action missing

前端 未结 1 1909
挽巷
挽巷 2021-01-17 00:48

I am trying to perform a POST of the action, however, when I make the request I get code 400 speaking that the action value is missing.

my code:

func         


        
相关标签:
1条回答
  • 2021-01-17 01:09

    UrlFetchApp doesn't have a data key parameter. Use payload instead.

    Reference:

    UrlFetchApp

    Code Snippet:

    UrlFetchApp.fetch(url,
        {
          method: "POST",
          headers: {
            "Authorization": "Bearer " + ScriptApp.getOAuthToken(),
          },
          contentType:  'application/json',
          payload: JSON.stringify({
            "action": "block"
          }),
          muteHttpExceptions: true
        });
    
    0 讨论(0)
提交回复
热议问题