Hi,
I'm making queries to a website to detect the language of a URL-encoded text. For an example, see
(In this example, the text input is "buenos+dias+se%C3%B1or".)
When the URL string becomes long (2076 characters) due to a long input text, Stata issues the following error message.
I figured that it is not a Mata-specific problem, because the same thing happens when Stata's file open command is used. It rather appears to be a problem of URL length: Reading a URL with 2075 characters works just fine, but for 2076 characters or more Stata complains.
However, if I manually copy the long URL into a browser (I use Chrome), the query works and the server responds well. That is, the server accepts long URLs (I also tried even longer ones). So I believe the restriction lies somewhere on Stata's end. I could not find any such restriction in URL length in the documentation (I understand that it is neither a problem of limitation in Mata's string scalars nor in Stata's filename string).
Thank you for any clarification or help on this issue!
I'm making queries to a website to detect the language of a URL-encoded text. For an example, see
Code:
mata cat("http://ws.detectlanguage.com/0.2/detect?q=buenos+dias+se%C3%B1or&key=demo")
When the URL string becomes long (2076 characters) due to a long input text, Stata issues the following error message.
Code:
host not found fopen(): 631 host not found cat(): - function returned error
However, if I manually copy the long URL into a browser (I use Chrome), the query works and the server responds well. That is, the server accepts long URLs (I also tried even longer ones). So I believe the restriction lies somewhere on Stata's end. I could not find any such restriction in URL length in the documentation (I understand that it is neither a problem of limitation in Mata's string scalars nor in Stata's filename string).
Thank you for any clarification or help on this issue!
Comment