dongleiqiao4906 2019-05-01 14:47
浏览 100

离子发送http.post和php接收GET请求

I already developed ionic 4 in my Mac. When trying to improve an app in ionic 3, my http.post (angular) calls in php is received as GET ($ _SERVER ['REQUEST_METHOD']). I discovered that my parameters are not being recognized in php. * I read the other posts and none solved my problem Thank you!

import { Http , Headers, RequestOptions} from '@angular/http';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/toPromise';

let parametros = JSON.stringify({
  idtApostador: localStorage.getItem("idtApostador"),
});
let headers = new Headers(
  {
    'Content-Type' : 'application/json'
  });
  let options = new RequestOptions({ headers: headers });
return new Promise(resolve => {
  this.http.post(url, parametros, options)
  .timeout(15000)
  .subscribe(data => {
  })
})
  • 写回答

2条回答 默认 最新

  • duanhe8280 2019-05-01 15:22
    关注

    I ask, I answer. :) https instead of http.

    评论

报告相同问题?

悬赏问题

  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程