开发者

How to pass params using fetch API in vuejs vuex store action

开发者 https://www.devze.com 2022-12-07 17:53 出处:网络
I am trying to pass a dict using fetch API to django views but unable to get it in request dict of views.

I am trying to pass a dict using fetch API to django views but unable to get it in request dict of views. I have tried below steps:

fetch(`/api/getnames`, [{'a': name, 'b': name}])
  .then()
  .catch((err) => {
    console.log('Fetch Error :-S', err);
  })
def getnames(request):
    print(request.__dict__)

I am trying to get the dict passed in par开发者_如何学运维ams while calling the url but dict is not present. Kindly suggest a solution to resolve this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号