添加自定义标题数据到Android HTTP请求自定义、标题、数据、HTTP

2023-09-06 18:04:27 作者:最终メ狂暴

我要在Android应用程序中发出HTTP请求。还有,我想添加一些自定义标题数据。具体来说,我将使用门票跟踪授权的请求(我这样做,所以我可以让事情的RESTful)。我希望能够基本上它添加到HTTP头文件

I'm going to be making HTTP requests in an android application. There is some custom header data that I'd like to add. Specifically, I'm going to be using tickets to track authorized requests (I'm doing this so I can keep things RESTful). I'd like be able to basically add this to the HTTP header

ticketId : someTicketId

什么是机器人要做到这一点最简单的方法是什么?

What is the simplest way to do this in android?

推荐答案

此功能看起来像它会做的伎俩。

This function looks like it will do the trick.

 
精彩推荐
图片推荐