标准库里的 web.rest.jsonLiteClient 无法正确提交cookie?换成光庆大佬的goking.http就可以,啥问题呢?大佬请教一下.
import web.rest.jsonLiteClient;
import debug.log;
var http = web.rest.jsonLiteClient();
http.setHeaders(
["Cookie"] = "TS01d3e4ba_28=0182fcb807ad144890f76001c0dd25dec58a9a8796468a5153730c4133827d3470ecb7916bf20659aa438cc3e29af897b3f2e5d2d9; blueking_language=zh-cn; bk_token=zD07ycMn6JwfvEW229bZWj16T4wohrqcxZ2OfNcdPkHcf5GYAPw3exV-Qdf64d22; sid=MTc0MzQ5ODg5OXxOd3dBTkVaSE4xcFhValkxVlVNMFRVUTNRVVZGVWxoR1ZWTkZWMGxFVUVaRVIwdzFTRTFJVlV0UFdVRXlSbEJNVEZaT1IwaFlSMUU9fL0o5H_bzkrtcqjkyY14Xk-fqOHlnpkM7Abi1JHGqM53; TS01d3e4ba=01a8387db694935c97af57120e168206482a194b4594eefc085e5b66f84df8a1ba4ec87542b2b78e1793d2930ec58f30c44912f887"
)
http.addHeaders = {
["Cookie"] = "TS01d3e4ba_28=0182fcb807ad144890f76001c0dd25dec58a9a8796468a5153730c4133827d3470ecb7916bf20659aa438cc3e29af897b3f2e5d2d9; blueking_language=zh-cn; bk_token=zD07ycMn6JwfvEW229bZWj16T4wohrqcxZ2OfNcdPkHcf5GYAPw3exV-Qdf64d22; sid=MTc0MzQ5ODg5OXxOd3dBTkVaSE4xcFhValkxVlVNMFRVUTNRVVZGVWxoR1ZWTkZWMGxFVUVaRVIwdzFTRTFJVlV0UFdVRXlSbEJNVEZaT1IwaFlSMUU9fL0o5H_bzkrtcqjkyY14Xk-fqOHlnpkM7Abi1JHGqM53; TS01d3e4ba=01a8387db694935c97af57120e168206482a194b4594eefc085e5b66f84df8a1ba4ec87542b2b78e1793d2930ec58f30c44912f887"
}
var res = http.get("http://localhost:8080/")
// 不管怎么传 cookie, 服务端都收不到.
debug.log.dump(res)
换成godking.http
import godking.http;
import debug.log;
var res = godking.http({
url = "http://localhost:8080/", header = {
"Cookie": "TS01d3e4ba_28=0182fcb807ad144890f76001c0dd25dec58a9a8796468a5153730c4133827d3470ecb7916bf20659aa438cc3e29af897b3f2e5d2d9; blueking_language=zh-cn; bk_token=zD07ycMn6JwfvEW229bZWj16T4wohrqcxZ2OfNcdPkHcf5GYAPw3exV-Qdf64d22; sid=MTc0MzQ5ODg5OXxOd3dBTkVaSE4xcFhValkxVlVNMFRVUTNRVVZGVWxoR1ZWTkZWMGxFVUVaRVIwdzFTRTFJVlV0UFdVRXlSbEJNVEZaT1IwaFlSMUU9fL0o5H_bzkrtcqjkyY14Xk-fqOHlnpkM7Abi1JHGqM53; TS01d3e4ba=01a8387db694935c97af57120e168206482a194b4594eefc085e5b66f84df8a1ba4ec87542b2b78e1793d2930ec58f30c44912f887"
}
});
// 服务端能收到,很丝滑
debug.log.dump(res)
那么到底是什么问题呢?我直接复制标准库里的例子也不行...还在inet.http里使用console.log打印日志,看着也正常,但是服务端就是无法收到,为什么?