Answers for "[Unhandled promise rejection: TypeError: Body not allowed for GET or HEAD requests]"

0

[Unhandled promise rejection: TypeError: Body not allowed for GET or HEAD requests]

// Please note that you cannot use body in GET Request. Please change it to POST.

var url = new URL("https://apitest.kuveytturk.com.tr/prep/v1/data/fecs"),
    params = {firstParam: 'isoCode ',
               secondParam: 'internationalCode',
               thirdParam: 'name',
               fourthParam: 'code',
               FifthParam: 'group',
               SixthParam: 'id'}
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]))
fetch(url).then(/* … */)
Posted by: Guest on October-04-2021

Code answers related to "[Unhandled promise rejection: TypeError: Body not allowed for GET or HEAD requests]"

Code answers related to "Javascript"

Browse Popular Code Answers by Language