1. <i id='PtmxS'><tr id='PtmxS'><dt id='PtmxS'><q id='PtmxS'><span id='PtmxS'><b id='PtmxS'><form id='PtmxS'><ins id='PtmxS'></ins><ul id='PtmxS'></ul><sub id='PtmxS'></sub></form><legend id='PtmxS'></legend><bdo id='PtmxS'><pre id='PtmxS'><center id='PtmxS'></center></pre></bdo></b><th id='PtmxS'></th></span></q></dt></tr></i><div id='PtmxS'><tfoot id='PtmxS'></tfoot><dl id='PtmxS'><fieldset id='PtmxS'></fieldset></dl></div>

      <small id='PtmxS'></small><noframes id='PtmxS'>

    2. <tfoot id='PtmxS'></tfoot>
        <bdo id='PtmxS'></bdo><ul id='PtmxS'></ul>
      <legend id='PtmxS'><style id='PtmxS'><dir id='PtmxS'><q id='PtmxS'></q></dir></style></legend>

        使用 json (body: raw) POST 数据时总是失败

        Always failed when POST data with json (body: raw)(使用 json (body: raw) POST 数据时总是失败)

        <small id='Z3XVF'></small><noframes id='Z3XVF'>

        <tfoot id='Z3XVF'></tfoot>

      1. <legend id='Z3XVF'><style id='Z3XVF'><dir id='Z3XVF'><q id='Z3XVF'></q></dir></style></legend>

              <bdo id='Z3XVF'></bdo><ul id='Z3XVF'></ul>
                <tbody id='Z3XVF'></tbody>

                <i id='Z3XVF'><tr id='Z3XVF'><dt id='Z3XVF'><q id='Z3XVF'><span id='Z3XVF'><b id='Z3XVF'><form id='Z3XVF'><ins id='Z3XVF'></ins><ul id='Z3XVF'></ul><sub id='Z3XVF'></sub></form><legend id='Z3XVF'></legend><bdo id='Z3XVF'><pre id='Z3XVF'><center id='Z3XVF'></center></pre></bdo></b><th id='Z3XVF'></th></span></q></dt></tr></i><div id='Z3XVF'><tfoot id='Z3XVF'></tfoot><dl id='Z3XVF'><fieldset id='Z3XVF'></fieldset></dl></div>

                • 本文介绍了使用 json (body: raw) POST 数据时总是失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I'm have trouble when send data to my server. I'm working with react native & axios ver ^0.16.2

                  let input = {
                    'longitude': -6.3922782,
                    'latitude': 106.8268856,
                    'content': 'uget - uget sampai kaki lemes',
                    'pictures': []
                  }
                  
                    axios({
                      method: 'POST',
                      url,
                      headers: {
                        'Content-Type': 'application/json',
                        'Authorization': this.state.headers.authorization
                      },
                      data: input
                    })                                                                     
                    .then((resultAxios) => {
                      console.log('hasil axios', resultAxios)
                    })
                  

                  and the status result always error 500.

                  If I try send data with postman, everything is fine. In postman, I set

                  headers: {
                    Authorization: ''',
                    Content-Type: application/json
                  }
                  
                  body = raw, JSON
                  

                  How can solve this problem? Thanks :)

                  解决方案

                  I've found that axios have some problem in the processing of json for body try this:

                  let input = 'longitude=-6.3922782&latitude=106.8268856&content="uget - uget sampai kaki lemes"&pictures=[]';
                  
                    axios({
                      method: 'POST',
                      url,
                      headers: {
                        'Content-Type': 'application/json',
                        'Authorization': this.state.headers.authorization
                      },
                      data: input
                    })                                                                     
                    .then((resultAxios) => {
                      console.log('hasil axios', resultAxios)
                    })
                  

                  and the status result always error 500.

                  If I try send data with postman, everything is fine. In postman, I set

                  headers: {
                    Authorization: ''',
                    Content-Type: application/json
                  }
                  
                  body = raw, JSON
                  

                  这篇关于使用 json (body: raw) POST 数据时总是失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))
                • <tfoot id='bSw7u'></tfoot>
                    <tbody id='bSw7u'></tbody>

                  <small id='bSw7u'></small><noframes id='bSw7u'>

                      <bdo id='bSw7u'></bdo><ul id='bSw7u'></ul>

                    • <i id='bSw7u'><tr id='bSw7u'><dt id='bSw7u'><q id='bSw7u'><span id='bSw7u'><b id='bSw7u'><form id='bSw7u'><ins id='bSw7u'></ins><ul id='bSw7u'></ul><sub id='bSw7u'></sub></form><legend id='bSw7u'></legend><bdo id='bSw7u'><pre id='bSw7u'><center id='bSw7u'></center></pre></bdo></b><th id='bSw7u'></th></span></q></dt></tr></i><div id='bSw7u'><tfoot id='bSw7u'></tfoot><dl id='bSw7u'><fieldset id='bSw7u'></fieldset></dl></div>
                      <legend id='bSw7u'><style id='bSw7u'><dir id='bSw7u'><q id='bSw7u'></q></dir></style></legend>