Here's a sequence of actions (note it is complicated cause mongoose is
asynchronous):

1. On MG_REQUEST, call mg_connect() to the remote host, interconnect two
mg_connection structures through "connection_param", and return MG_MORE
2. mg_connect() will trigger MG_CONNECT. There, mg_printf() the request to
the connection.
3. Remote host will reply, and trigger MG_REPLY. There, process the reply,
and send back data to the client using inter-connected structure. Mark as
done, disconnect structures.
4. In MG_POLL, return MG_TRUE is marked as done. That will close the
original connection.


On Tue, Aug 5, 2014 at 4:21 PM, Charlie Scott-Skinner <
[email protected]> wrote:

> OK I see where I went wrong...duh.
> I was switching on MS_WS_CONNECT, not MG_CONNECT :/
>
> So now I have this:
>
> case MG_CONNECT:
> {
> connection->http_version = "1.0";
> connection->uri = "/gapi/translate";
> connection->query_string =
> "from=eng&dest=fra&format=xml&phrase=cat&pretty=true";
> connection->request_method = "GET";
>
> result = MG_TRUE;
> }
> break;
>
> Which is connecting and returning a result, but it's returning 400 - bad
> request.
>
> Any idea what stupid thing I'm doing this time?
>
> Because I know the API works...
>
> http://glosbe.com/gapi/translate?from=eng&dest=fra&format=xml&phrase=cat&pretty=true
>
>  --
> You received this message because you are subscribed to the Google Groups
> "mongoose-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mongoose-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to