22 Sep
2010

IWeb Response 400 BrewMP

Error 400 is bad request

Brew MP supports Get and Post Request as of now .

Typical POST request

IWEB_GetResponse(pHttpPost->piWeb, (pHttpPost->piWeb, &(pHttpPost->piWebResp), &(pHttpPost->cb), pHttpPost->url,
WEBOPT_HANDLERDATA,pHttpPost,
WEBOPT_HEADER,HTTP_POST_HEADER_MULTIPART,
WEBOPT_METHOD,"POST",
WEBOPT_FLAGS , WEBREQUEST_FORCENEWCONN,
WEBOPT_BODY,data,
WEBOPT_CONTENTLENGTH,sourceLen,
WEBOPT_END));

Bad Request Error here can be a possible “bad header”
Or Can be “bad URL”

Typical GET Request

IWEB_GetResponse(pHttpPost->piWeb, (pHttpPost->piWeb, &(pHttpPost->piWebResp), &(pHttpPost->cb), pHttpPost->url));

Here the only possibility for Bad Request Error (ncode 400) is possibly bad URL again .

Bad URL Means any “Space” character in the URL or other char like < , > etc .
The Url used must be prepared using IWebUtil_UrlEncode() to be on the safer side .

Hope this helped

Follow Me!

Follow Me! Follow Me! Follow Me! Follow Me!