How to read/output response from the HTTP request The Next CEO of Stack OverflowWhat's the difference between a POST and a PUT HTTP REQUEST?HTTP GET request in JavaScript?Is an entity body allowed for an HTTP DELETE request?HTTP GET with request bodymaximum length of HTTP GET request?How to use java.net.URLConnection to fire and handle HTTP requestsHTTP response code for POST when resource already existsHow to make HTTP POST web requestHow is an HTTP POST request made in node.js?How are parameters sent in an HTTP POST request?

Grabbing quick drinks

What do "high sea" and "carry" mean in this sentence?

How to safely derail a train during transit?

What's the point of interval inversion?

How to get regions to plot as graphics

Shade part of a Venn diagram

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?

How to be diplomatic in refusing to write code that breaches the privacy of our users

How to write the block matrix in LaTex?

How easy is it to start Magic from scratch?

What is the purpose of the Evocation wizard's Potent Cantrip feature?

Implement the Thanos sorting algorithm

Why doesn't a table tennis ball float on the surface? How do we calculate buoyancy here?

Is it okay to store user locations?

How to write papers efficiently when English isn't my first language?

Can I equip Skullclamp on a creature I am sacrificing?

Inappropriate reference requests from Journal reviewers

Term for the "extreme-extension" version of a straw man fallacy?

Text adventure game code

% symbol leads to superlong (forever?) compilations

Anatomically Correct Strange Women In Ponds Distributing Swords

Only print output after finding pattern

Why do remote companies require working in the US?

WOW air has ceased operation, can I get my tickets refunded?



How to read/output response from the HTTP request



The Next CEO of Stack OverflowWhat's the difference between a POST and a PUT HTTP REQUEST?HTTP GET request in JavaScript?Is an entity body allowed for an HTTP DELETE request?HTTP GET with request bodymaximum length of HTTP GET request?How to use java.net.URLConnection to fire and handle HTTP requestsHTTP response code for POST when resource already existsHow to make HTTP POST web requestHow is an HTTP POST request made in node.js?How are parameters sent in an HTTP POST request?










-1















I send HTTP request to a webpage to insert or retrieve data.



This is my code:



string json = JsonConvert.SerializeObject(user);
using (var client = new HttpClient())

var response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", response, "test");


For this particular example; the website should return true or false.



But I want to read the response variable.



The DisplayAlert("test", response, "test"); show error. And this is because I am trying to read response outside of scope.



My question is how to read the response variable or output response variable on the page?



Edit




LoginModel user = new LoginModel();

user.email = email.Text;
user.password = password.Text;

;

string json = JsonConvert.SerializeObject(user);

using (var client = new HttpClient())





var response = client.PostAsync(
"https://scs.agsigns.co.uk/tasks/photoapi/login-photoapi/login-check.php",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", response, "test");











share|improve this question
























  • Move response outside of using. HttpResponseMessage response; using(var client ...). Another thing is, you are not awaiting your PostAsnyc() call which will led to response being of type Task<HttpResponseMessage>

    – croxy
    Mar 8 at 13:00












  • If I move response outside; Than I get red line under "client". See Edit original question

    – James Hickling
    Mar 8 at 13:05












  • You should only move the declaration of response outside of the using. The client.PostAsync() call should stay inside of the using.

    – croxy
    Mar 8 at 13:07











  • docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/…

    – demo
    Mar 8 at 13:08











  • response.Content.ReadAsStringAsync()

    – miechooy
    Mar 8 at 13:14















-1















I send HTTP request to a webpage to insert or retrieve data.



This is my code:



string json = JsonConvert.SerializeObject(user);
using (var client = new HttpClient())

var response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", response, "test");


For this particular example; the website should return true or false.



But I want to read the response variable.



The DisplayAlert("test", response, "test"); show error. And this is because I am trying to read response outside of scope.



My question is how to read the response variable or output response variable on the page?



Edit




LoginModel user = new LoginModel();

user.email = email.Text;
user.password = password.Text;

;

string json = JsonConvert.SerializeObject(user);

using (var client = new HttpClient())





var response = client.PostAsync(
"https://scs.agsigns.co.uk/tasks/photoapi/login-photoapi/login-check.php",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", response, "test");











share|improve this question
























  • Move response outside of using. HttpResponseMessage response; using(var client ...). Another thing is, you are not awaiting your PostAsnyc() call which will led to response being of type Task<HttpResponseMessage>

    – croxy
    Mar 8 at 13:00












  • If I move response outside; Than I get red line under "client". See Edit original question

    – James Hickling
    Mar 8 at 13:05












  • You should only move the declaration of response outside of the using. The client.PostAsync() call should stay inside of the using.

    – croxy
    Mar 8 at 13:07











  • docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/…

    – demo
    Mar 8 at 13:08











  • response.Content.ReadAsStringAsync()

    – miechooy
    Mar 8 at 13:14













-1












-1








-1








I send HTTP request to a webpage to insert or retrieve data.



This is my code:



string json = JsonConvert.SerializeObject(user);
using (var client = new HttpClient())

var response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", response, "test");


For this particular example; the website should return true or false.



But I want to read the response variable.



The DisplayAlert("test", response, "test"); show error. And this is because I am trying to read response outside of scope.



My question is how to read the response variable or output response variable on the page?



Edit




LoginModel user = new LoginModel();

user.email = email.Text;
user.password = password.Text;

;

string json = JsonConvert.SerializeObject(user);

using (var client = new HttpClient())





var response = client.PostAsync(
"https://scs.agsigns.co.uk/tasks/photoapi/login-photoapi/login-check.php",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", response, "test");











share|improve this question
















I send HTTP request to a webpage to insert or retrieve data.



This is my code:



string json = JsonConvert.SerializeObject(user);
using (var client = new HttpClient())

var response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", response, "test");


For this particular example; the website should return true or false.



But I want to read the response variable.



The DisplayAlert("test", response, "test"); show error. And this is because I am trying to read response outside of scope.



My question is how to read the response variable or output response variable on the page?



Edit




LoginModel user = new LoginModel();

user.email = email.Text;
user.password = password.Text;

;

string json = JsonConvert.SerializeObject(user);

using (var client = new HttpClient())





var response = client.PostAsync(
"https://scs.agsigns.co.uk/tasks/photoapi/login-photoapi/login-check.php",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", response, "test");








c# http






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 13:06







James Hickling

















asked Mar 8 at 12:59









James HicklingJames Hickling

65




65












  • Move response outside of using. HttpResponseMessage response; using(var client ...). Another thing is, you are not awaiting your PostAsnyc() call which will led to response being of type Task<HttpResponseMessage>

    – croxy
    Mar 8 at 13:00












  • If I move response outside; Than I get red line under "client". See Edit original question

    – James Hickling
    Mar 8 at 13:05












  • You should only move the declaration of response outside of the using. The client.PostAsync() call should stay inside of the using.

    – croxy
    Mar 8 at 13:07











  • docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/…

    – demo
    Mar 8 at 13:08











  • response.Content.ReadAsStringAsync()

    – miechooy
    Mar 8 at 13:14

















  • Move response outside of using. HttpResponseMessage response; using(var client ...). Another thing is, you are not awaiting your PostAsnyc() call which will led to response being of type Task<HttpResponseMessage>

    – croxy
    Mar 8 at 13:00












  • If I move response outside; Than I get red line under "client". See Edit original question

    – James Hickling
    Mar 8 at 13:05












  • You should only move the declaration of response outside of the using. The client.PostAsync() call should stay inside of the using.

    – croxy
    Mar 8 at 13:07











  • docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/…

    – demo
    Mar 8 at 13:08











  • response.Content.ReadAsStringAsync()

    – miechooy
    Mar 8 at 13:14
















Move response outside of using. HttpResponseMessage response; using(var client ...). Another thing is, you are not awaiting your PostAsnyc() call which will led to response being of type Task<HttpResponseMessage>

– croxy
Mar 8 at 13:00






Move response outside of using. HttpResponseMessage response; using(var client ...). Another thing is, you are not awaiting your PostAsnyc() call which will led to response being of type Task<HttpResponseMessage>

– croxy
Mar 8 at 13:00














If I move response outside; Than I get red line under "client". See Edit original question

– James Hickling
Mar 8 at 13:05






If I move response outside; Than I get red line under "client". See Edit original question

– James Hickling
Mar 8 at 13:05














You should only move the declaration of response outside of the using. The client.PostAsync() call should stay inside of the using.

– croxy
Mar 8 at 13:07





You should only move the declaration of response outside of the using. The client.PostAsync() call should stay inside of the using.

– croxy
Mar 8 at 13:07













docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/…

– demo
Mar 8 at 13:08





docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/…

– demo
Mar 8 at 13:08













response.Content.ReadAsStringAsync()

– miechooy
Mar 8 at 13:14





response.Content.ReadAsStringAsync()

– miechooy
Mar 8 at 13:14












2 Answers
2






active

oldest

votes


















1














This gives you an error because you try to access a variable which is declared inside of a different scope. If you move the variable response inside of the "method scope" the error will disappear:



string json = JsonConvert.SerializeObject(user);

HttpResponseMessage response;
using (var client = new HttpClient())

response = await client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", await response.Content.ReadAsStringAsync(), "test");


Note the await which I added just before client.PostAsync() (You will find more infos about async/await in the docs).



To get the string representation of the response content you can use following method:



await response.Content.ReadAsStringAsync(); 


This will read the response content as string.






share|improve this answer

























  • Thanks, @croxy. Still getting response conversion to string error. " Argument 2: cannot convert from 'System.Net.Http.HttpResponseMessage' to 'string'"

    – James Hickling
    Mar 8 at 13:19


















0














string json = JsonConvert.SerializeObject(user);
HttpResponseMessage response;
using (var client = new HttpClient())

response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json").Result);

var body = response.Content.ReadAsStringAsync().Result;
DisplayAlert("Alert", json, "OK");
DisplayAlert("test", body, "test");


should work, by moving the declaration of the variable outside the scope, and updating the value inside the call.






share|improve this answer

























  • Thanks, it looks like it worked. Just threw another error - " cannot convert from 'System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>' to 'string'"...I believe I need to convert this into string; not sure what would be best practice to do so.

    – James Hickling
    Mar 8 at 13:13











  • Try the updated answer

    – Ghanima
    Mar 8 at 13:19











  • Thanks, @Crowxy and A Ghanima for all your help. I can see the response now. Thanks

    – James Hickling
    Mar 8 at 13:24











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063743%2fhow-to-read-output-response-from-the-http-request%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














This gives you an error because you try to access a variable which is declared inside of a different scope. If you move the variable response inside of the "method scope" the error will disappear:



string json = JsonConvert.SerializeObject(user);

HttpResponseMessage response;
using (var client = new HttpClient())

response = await client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", await response.Content.ReadAsStringAsync(), "test");


Note the await which I added just before client.PostAsync() (You will find more infos about async/await in the docs).



To get the string representation of the response content you can use following method:



await response.Content.ReadAsStringAsync(); 


This will read the response content as string.






share|improve this answer

























  • Thanks, @croxy. Still getting response conversion to string error. " Argument 2: cannot convert from 'System.Net.Http.HttpResponseMessage' to 'string'"

    – James Hickling
    Mar 8 at 13:19















1














This gives you an error because you try to access a variable which is declared inside of a different scope. If you move the variable response inside of the "method scope" the error will disappear:



string json = JsonConvert.SerializeObject(user);

HttpResponseMessage response;
using (var client = new HttpClient())

response = await client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", await response.Content.ReadAsStringAsync(), "test");


Note the await which I added just before client.PostAsync() (You will find more infos about async/await in the docs).



To get the string representation of the response content you can use following method:



await response.Content.ReadAsStringAsync(); 


This will read the response content as string.






share|improve this answer

























  • Thanks, @croxy. Still getting response conversion to string error. " Argument 2: cannot convert from 'System.Net.Http.HttpResponseMessage' to 'string'"

    – James Hickling
    Mar 8 at 13:19













1












1








1







This gives you an error because you try to access a variable which is declared inside of a different scope. If you move the variable response inside of the "method scope" the error will disappear:



string json = JsonConvert.SerializeObject(user);

HttpResponseMessage response;
using (var client = new HttpClient())

response = await client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", await response.Content.ReadAsStringAsync(), "test");


Note the await which I added just before client.PostAsync() (You will find more infos about async/await in the docs).



To get the string representation of the response content you can use following method:



await response.Content.ReadAsStringAsync(); 


This will read the response content as string.






share|improve this answer















This gives you an error because you try to access a variable which is declared inside of a different scope. If you move the variable response inside of the "method scope" the error will disappear:



string json = JsonConvert.SerializeObject(user);

HttpResponseMessage response;
using (var client = new HttpClient())

response = await client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json"));


DisplayAlert("Alert", json, "OK");
DisplayAlert("test", await response.Content.ReadAsStringAsync(), "test");


Note the await which I added just before client.PostAsync() (You will find more infos about async/await in the docs).



To get the string representation of the response content you can use following method:



await response.Content.ReadAsStringAsync(); 


This will read the response content as string.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 8 at 13:20

























answered Mar 8 at 13:11









croxycroxy

2,95072039




2,95072039












  • Thanks, @croxy. Still getting response conversion to string error. " Argument 2: cannot convert from 'System.Net.Http.HttpResponseMessage' to 'string'"

    – James Hickling
    Mar 8 at 13:19

















  • Thanks, @croxy. Still getting response conversion to string error. " Argument 2: cannot convert from 'System.Net.Http.HttpResponseMessage' to 'string'"

    – James Hickling
    Mar 8 at 13:19
















Thanks, @croxy. Still getting response conversion to string error. " Argument 2: cannot convert from 'System.Net.Http.HttpResponseMessage' to 'string'"

– James Hickling
Mar 8 at 13:19





Thanks, @croxy. Still getting response conversion to string error. " Argument 2: cannot convert from 'System.Net.Http.HttpResponseMessage' to 'string'"

– James Hickling
Mar 8 at 13:19













0














string json = JsonConvert.SerializeObject(user);
HttpResponseMessage response;
using (var client = new HttpClient())

response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json").Result);

var body = response.Content.ReadAsStringAsync().Result;
DisplayAlert("Alert", json, "OK");
DisplayAlert("test", body, "test");


should work, by moving the declaration of the variable outside the scope, and updating the value inside the call.






share|improve this answer

























  • Thanks, it looks like it worked. Just threw another error - " cannot convert from 'System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>' to 'string'"...I believe I need to convert this into string; not sure what would be best practice to do so.

    – James Hickling
    Mar 8 at 13:13











  • Try the updated answer

    – Ghanima
    Mar 8 at 13:19











  • Thanks, @Crowxy and A Ghanima for all your help. I can see the response now. Thanks

    – James Hickling
    Mar 8 at 13:24















0














string json = JsonConvert.SerializeObject(user);
HttpResponseMessage response;
using (var client = new HttpClient())

response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json").Result);

var body = response.Content.ReadAsStringAsync().Result;
DisplayAlert("Alert", json, "OK");
DisplayAlert("test", body, "test");


should work, by moving the declaration of the variable outside the scope, and updating the value inside the call.






share|improve this answer

























  • Thanks, it looks like it worked. Just threw another error - " cannot convert from 'System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>' to 'string'"...I believe I need to convert this into string; not sure what would be best practice to do so.

    – James Hickling
    Mar 8 at 13:13











  • Try the updated answer

    – Ghanima
    Mar 8 at 13:19











  • Thanks, @Crowxy and A Ghanima for all your help. I can see the response now. Thanks

    – James Hickling
    Mar 8 at 13:24













0












0








0







string json = JsonConvert.SerializeObject(user);
HttpResponseMessage response;
using (var client = new HttpClient())

response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json").Result);

var body = response.Content.ReadAsStringAsync().Result;
DisplayAlert("Alert", json, "OK");
DisplayAlert("test", body, "test");


should work, by moving the declaration of the variable outside the scope, and updating the value inside the call.






share|improve this answer















string json = JsonConvert.SerializeObject(user);
HttpResponseMessage response;
using (var client = new HttpClient())

response = client.PostAsync(
"url",
new StringContent(json, Encoding.UTF8, "application/json").Result);

var body = response.Content.ReadAsStringAsync().Result;
DisplayAlert("Alert", json, "OK");
DisplayAlert("test", body, "test");


should work, by moving the declaration of the variable outside the scope, and updating the value inside the call.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 8 at 13:19

























answered Mar 8 at 13:02









GhanimaGhanima

5881216




5881216












  • Thanks, it looks like it worked. Just threw another error - " cannot convert from 'System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>' to 'string'"...I believe I need to convert this into string; not sure what would be best practice to do so.

    – James Hickling
    Mar 8 at 13:13











  • Try the updated answer

    – Ghanima
    Mar 8 at 13:19











  • Thanks, @Crowxy and A Ghanima for all your help. I can see the response now. Thanks

    – James Hickling
    Mar 8 at 13:24

















  • Thanks, it looks like it worked. Just threw another error - " cannot convert from 'System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>' to 'string'"...I believe I need to convert this into string; not sure what would be best practice to do so.

    – James Hickling
    Mar 8 at 13:13











  • Try the updated answer

    – Ghanima
    Mar 8 at 13:19











  • Thanks, @Crowxy and A Ghanima for all your help. I can see the response now. Thanks

    – James Hickling
    Mar 8 at 13:24
















Thanks, it looks like it worked. Just threw another error - " cannot convert from 'System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>' to 'string'"...I believe I need to convert this into string; not sure what would be best practice to do so.

– James Hickling
Mar 8 at 13:13





Thanks, it looks like it worked. Just threw another error - " cannot convert from 'System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>' to 'string'"...I believe I need to convert this into string; not sure what would be best practice to do so.

– James Hickling
Mar 8 at 13:13













Try the updated answer

– Ghanima
Mar 8 at 13:19





Try the updated answer

– Ghanima
Mar 8 at 13:19













Thanks, @Crowxy and A Ghanima for all your help. I can see the response now. Thanks

– James Hickling
Mar 8 at 13:24





Thanks, @Crowxy and A Ghanima for all your help. I can see the response now. Thanks

– James Hickling
Mar 8 at 13:24

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063743%2fhow-to-read-output-response-from-the-http-request%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived