网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
05月10日漏签0天
php吧 关注:280,654贴子:1,320,582
  • 看贴

  • 图片

  • 吧主推荐

  • 视频

  • 游戏

  • 2回复贴,共1页
<<返回php吧
>0< 加载中...

CI4框架controller如何相互调用

  • 取消只看楼主
  • 收藏

  • 回复
  • 尕御摩羯
  • 路过酱油
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
如图,我使用composer创建了两个ci4框架的项目,项目A接口使用$_POST接收数据

现在我在开发项目B的时候想要调用项目A的接口,我看了ci4的文档,使用了curlRequest进行调用,代码如下图所示

现在的问题是,可以调通接口,但是参数没有传过去,请问各位大佬如何解决


  • 尕御摩羯
  • 路过酱油
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
顶一下


2025-05-10 08:49:35
广告
  • 尕御摩羯
  • 路过酱油
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
CodeIgniter\HTTP\Response Object( [reason:protected] => OK [statusCode:protected] => 200 [pretend:protected] => [protocolVersion:protected] => 1.1 [validProtocolVersions:protected] => Array ( [0] => 1.0 [1] => 1.1 [2] => 2.0 )
[body:protected] => {"state":1,"data":[{"user_id":"1","vuid":"","username":"333","nickname":"qqq","realname":"jin","phone":"13313656661","password":"222","photo":"","created_at":"2022-04-07 11:54:03","updated_at":"2022-04-07 11:54:03"},{"user_id":"2","vuid":"","username":"a333","nickname":"qqq111111111111111","realname":"jin","phone":"13313656661","password":"22233322212","photo":"","created_at":"2022-04-07 15:03:45","updated_at":"2022-04-07 15:03:45"},{"user_id":"3","vuid":"","username":"a333","nickname":"qqq111111111111111","realname":"jin","phone":"13313656661","password":"22233322212","photo":"","created_at":"2022-04-07 15:16:51","updated_at":"2022-04-07 15:16:51"},{"user_id":"4","vuid":"164931637860","username":"a333","nickname":"qqq111111111111111","realname":"jin","phone":"13313656661","password":"22233322212","photo":"","created_at":"2022-04-07 15:26:18","updated_at":"2022-04-07 15:26:18"},{"user_id":"5","vuid":"164932179893","username":"a3334","nickname":"qqq111111111111111","realname":"jin","phone":"13313656662","password":"dfe382df655bc8463f48d4edfb8bf2b5","photo":"","created_at":"2022-04-07 16:56:38","updated_at":"2022-04-07 16:56:38"}]} [headers:protected] => Array ( [Cache-control] => CodeIgniter\HTTP\Header Object ( [name:protected] => Cache-control [value:protected] => Array ( [0] => no-store [1] => max-age=0 [2] => no-cache )
)
[Content-Type] => CodeIgniter\HTTP\Header Object ( [name:protected] => Content-Type [value:protected] => text/html; charset=utf-8 )
[Date] => CodeIgniter\HTTP\Header Object ( [name:protected] => Date [value:protected] => Sun, 10 Apr 2022 08:08:50 GMT )
[Server] => CodeIgniter\HTTP\Header Object ( [name:protected] => Server [value:protected] => Apache/2.4.46 (Win64) PHP/7.3.21 )
[X-Powered-By] => CodeIgniter\HTTP\Header Object ( [name:protected] => X-Powered-By [value:protected] => PHP/7.3.21 )
[Access-Control-Allow-Origin] => CodeIgniter\HTTP\Header Object ( [name:protected] => Access-Control-Allow-Origin [value:protected] => * )
[Content-Length] => CodeIgniter\HTTP\Header Object ( [name:protected] => Content-Length [value:protected] => 1147 )
)
[headerMap:protected] => Array ( [cache-control] => Cache-control [content-type] => Content-Type [date] => Date [server] => Server [x-powered-by] => X-Powered-By [access-control-allow-origin] => Access-Control-Allow-Origin [content-length] => Content-Length )
[CSPEnabled:protected] => [CSP] => CodeIgniter\HTTP\ContentSecurityPolicy Object ( [baseURI:protected] => [childSrc:protected] => self [connectSrc:protected] => self [defaultSrc:protected] => [fontSrc:protected] => [formAction:protected] => self [frameAncestors:protected] => [frameSrc:protected] => [imageSrc:protected] => self [mediaSrc:protected] => [objectSrc:protected] => self [pluginTypes:protected] => [reportURI:protected] => [sandbox:protected] => [scriptSrc:protected] => self [styleSrc:protected] => self [manifestSrc:protected] => [upgradeInsecureRequests:protected] => [reportOnly:protected] => [validSources:protected] => Array ( [0] => self [1] => none [2] => unsafe-inline [3] => unsafe-eval )
[nonces:protected] => Array ( )
[tempHeaders:protected] => Array ( )
[reportOnlyHeaders:protected] => Array ( )
)
[cookieStore:protected] => CodeIgniter\Cookie\CookieStore Object ( [cookies:protected] => Array ( )
)
[cookiePrefix:protected] => [cookieDomain:protected] => [cookiePath:protected] => / [cookieSecure:protected] => [cookieHTTPOnly:protected] => 1 [cookieSameSite:protected] => Lax [cookies:protected] => Array ( )
[bodyFormat:protected] => html)


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 2回复贴,共1页
<<返回php吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示