I cannot find out what's wrong with abs_path being "/search?search=Thrust+washers", and, what's more, how to debug this.
Class: error
Exception: {badmatch,{error,invalid_uri}}
Req: {http_request,'GET',{abs_path,"/search?search=Thrust+washers"},{1,1}}
Stack: [{myurl,pass_through,1,
[{file,"/usr/local/lib/yaws/voxx/ebin/myurl.erl"},{line,507}]},
Line 506:
Http_result = httpc:request(Url),
{ok, {{V, S, R}, _, _}} = Http_result,
It seems to be caused by + (or %20) characters in Url, but these are perfectly legal.
I found Yaws process died: {{badmatch,<<>>} and the answer of Steve Vinoski, but cannot make use of it due to lack of experience.
I don't know the exact nature of your application, but I'm guessing that what it's doing is that Yaws receives a request on a URL with a query containing the data you show, and then your code is attempting to use the Yaws-parsed URL to make a request as an HTTP client. I was able to duplicate your problem with this sort of setup.
I believe the '+' character in your query has to be URL-encoded because '+' is listed as reserved in the "Uniform Resource Identifier (URI): Generic Syntax" specification, Section 2.2 (RFC3986); it is normally used to represent space characters in queries.
Using the Erlang functions in the
uri_stringmodule to compose a query, we see that it gets encoded:We see the same in Python:
If you make a curl request to Yaws using a URL with the query encoded in this manner, Yaws decodes your query as
{"page","x+y"}as you'd expect.