Giter VIP home page Giter VIP logo

Comments (2)

gospider007 avatar gospider007 commented on June 12, 2024

所有的参数都跟网页一样的情况下,无论是GET还是POST请求都返回了状态码 403。

有没有最小demo

from req.

tsingroo avatar tsingroo commented on June 12, 2024
package main

import (
	"fmt"
	"log"

	"github.com/imroc/req/v3"
)

func main() {
	PROXY_URL := ""       // 代理的IP和端口
	CONVERSATION_ID := "" // 这个是会话ID
	AUTHORIZATION := ""   // 这个是从网页版拿到的Authorization字段

	client := req.C().SetProxyURL(PROXY_URL)

	resp, err := client.R().
		SetHeader("Accept", "*/*").
		SetHeader("Authorization", AUTHORIZATION).
		SetHeader("Host", "chat.openai.com").
		SetHeader("Referer", "https://chat.openai.com").
		SetHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0").
		Get("https://chat.openai.com/backend-api/conversation/" + CONVERSATION_ID)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("resp.StatusCode", resp.StatusCode)
	fmt.Println(resp)
}

相同的参数用cycleTls可以请求成功,但是cycleTls不支持Stream模式读取响应

from req.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.