You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A clear and concise description of what you want to happen. Include any relevant links or screenshots or inspiration.
hello, I check the source code in /src/khoj/interface/web/chat.html
here is use GET but not POST
let url =/api/chat?q=${encodeURIComponent(query)}&n=${resultsCount}&client=web&stream=true&conversation_id=${conversationID}®ion=${region}&city=${city}&country=${countryName};
I asked gpt,so the answer is :
This line of code constructs a URL that includes the query parameters and other information collected from the front end. Then, this URL is used in a fetch() call, which effectively sends a GET request to the server. This process involves:
Retrieving the user input for the query.
Encoding the query content along with other relevant information (such as result count, client type, session ID, and geographical location information, etc.) into the URL's query string.
Using this URL to initiate a network request to the server-side corresponding API endpoint through the browser.
In this process, after receiving this GET request, the server processes it based on the request's parameters and returns the appropriate data.
If you want to change to using the POST method to submit information, you need to modify this part of the logic, create a request body, and then send this request body via a POST request, instead of appending all information in the query string of the URL. One advantage of doing this is that POST requests do not expose data in the URL, making them suitable for sending large amounts of data or sensitive information.
The text was updated successfully, but these errors were encountered:
Hey @melfebulu ! Was there a particular reason why you wanted to use POST over GET here? I certainly see your point, wouldn't mind switching over, but curious to hear if you hit a specific limitation.
Describe the feature you'd like
A clear and concise description of what you want to happen. Include any relevant links or screenshots or inspiration.
hello, I check the source code in /src/khoj/interface/web/chat.html
here is use GET but not POST
let url =
/api/chat?q=${encodeURIComponent(query)}&n=${resultsCount}&client=web&stream=true&conversation_id=${conversationID}®ion=${region}&city=${city}&country=${countryName};
I asked gpt,so the answer is :
Retrieving the user input for the query.
Encoding the query content along with other relevant information (such as result count, client type, session ID, and geographical location information, etc.) into the URL's query string.
Using this URL to initiate a network request to the server-side corresponding API endpoint through the browser.
In this process, after receiving this GET request, the server processes it based on the request's parameters and returns the appropriate data.
If you want to change to using the POST method to submit information, you need to modify this part of the logic, create a request body, and then send this request body via a POST request, instead of appending all information in the query string of the URL. One advantage of doing this is that POST requests do not expose data in the URL, making them suitable for sending large amounts of data or sensitive information.
The text was updated successfully, but these errors were encountered: