Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

[BUG]Return http status other than 200 are treated as failed request #87

Open
workerbeesh opened this issue Aug 6, 2020 · 0 comments
Open
Labels

Comments

@workerbeesh
Copy link

Describe the bug
Return http status other than 200 are treated as failed(status false)

To Reproduce
Simply construct any FuelObject derived object instance, after providing essential data and do a Post() call. The PostReturn object
will give you the Status false and there is no Results object attached in the PostReturn instance.

Expected behavior
Expecting all HTTP 2xx status should be qualified as success and return Results object if received any.

The suspected issue could be happening at method FuelSDK.FuelReturn.ExecuteFuel around this section

488			try
			{
				using (var response = (HttpWebResponse)request.GetResponse())
				using (var dataStream = response.GetResponseStream())
				using (var reader = new StreamReader(dataStream))
				{
					Code = (int)response.StatusCode;
					Status = (response.StatusCode == HttpStatusCode.OK);         //<= only checks for http 200
					MoreResults = false;
					Message = (Status ? string.Empty : response.ToString());
					return (Status ? reader.ReadToEnd() : null);
				}
500			}

@workerbeesh workerbeesh added the bug label Aug 6, 2020
@workerbeesh workerbeesh changed the title [BUG] [BUG]Return http status other than 200 are treated as failed request Aug 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant