Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can its web interface be encapsulated as an api for use in the node environment? #2

Open
lys623 opened this issue Nov 11, 2023 · 1 comment

Comments

@lys623
Copy link

lys623 commented Nov 11, 2023

when copy as node.js fetch At the console, throw errors;

image

@lys623
Copy link
Author

lys623 commented Nov 11, 2023

fetch("https://www.phind.com/api/agent", { "headers": { "accept": "*/*", "accept-language": "zh-CN,zh;q=0.9", "baggage": "sentry-environment=production,sentry-release=f1087ddca68f3a92870264bbbdc02de69a822b2a,sentry-public_key=ea29c13458134fd3bc88a8bb4ba668cb,sentry-trace_id=9ac976602fda40a9bbf6edf0806db095", "cache-control": "no-cache", "content-type": "application/json", "pragma": "no-cache", "sec-ch-ua": "\"Google Chrome\";v=\"119\", \"Chromium\";v=\"119\", \"Not?A_Brand\";v=\"24\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"macOS\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "sentry-trace": "9ac976602fda40a9bbf6edf0806db095-aad63b5260e32a69-0", "Cookie":"_ga=GA1.1.1944716401.1699547552; __Host-next-auth.csrf-token=f2eeebd5295025eaf04be8da52d2d9afd1d0d4ba0334129782f03c34e8d1d84e%7Cb6b0685b86a63b16967875f758eb793941db9206ec9ec383bab1e97774b44abd; __Secure-next-auth.callback-url=https%3A%2F%2Fwww.phind.com%2Fagent%3Fcache%3Dclotpfr4t000ql607j4wgescp; __cf_bm=S6zIO88mlP0iGZ5M8xfU0mqIznSF4DN__xOuXkL0u8U-1699688949-0-AVW6RtArrFmCtj1hLB/jVTNxb0vPfq19uwTTIhfEpHZDknvFky+10R99dxS1UA0N65tU/W1EZ936ODnRlt4NHtk=; mp_6d31cd4238973a84421371ef3929c915_mixpanel=%7B%22distinct_id%22%3A%20%22clohezdst0004lb08bnugq75f%22%2C%22%24device_id%22%3A%20%2218bbd3ada12a9b-00abc915694848-16525634-1ea000-18bbd3ada13f7f%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2Fwww.phind.com%2Fagent%3Fcache%3Dclotpfr4t000ql607j4wgescp%22%2C%22%24initial_referring_domain%22%3A%20%22www.phind.com%22%2C%22%24user_id%22%3A%20%22clohezdst0004lb08bnugq75f%22%7D; cf_clearance=GhuIiVWO46vlU4e0eamf56P6lfBdxlA5O3fL1fXfv1Q-1699689093-0-1-6afc3a5a.a077d6b2.3dfd65ba-0.2.1699689093; __Secure-next-auth.session-token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..yPn1qgQxFF7Vzij5.xo1jhWWjPo-TjV28pXa5cNyhCdKNbGa0oTtsCOitMS5aWlpeNBlXvGee6DX_u5wBMHtdILkXAb3MTo_oqKh86r7LtmrTs_qwL0a5sl07nAKZt27AIqBJ6JmWF34arUfjiwTne_qCMyG6o1EUbD_yLO2f3qBgAf3t66YjNm4vpRbMz6rPMoIdwO3lyDDRFORCEnU9Pif8U63aCos3uGu4NdPGkQ7jTyGJyT_T2_uEEo2gg_piLe212s7iK0fd0gbq5Hewmv8x.d64iT9eweWKGjwGQkdEWHA; _ga_XCLTX4ZEX8=GS1.1.1699685989.3.1.1699689106.39.0.0" }, "referrer": "https://www.phind.com/agent?cache=", "referrerPolicy": "strict-origin-when-cross-origin", "body": "{\"userInput\":\"你好\",\"messages\":[],\"pinnedMessages\":[],\"anonUserID\":\"\"}", "method": "POST", "mode": "cors", "credentials": "include" }).then((res)=>{ console.log('res',res) }) can run in chrome devtools console, error in node env,403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant