catch all
This commit is contained in:
parent
cd17b7b155
commit
79ce655eb8
1 changed files with 9 additions and 6 deletions
|
|
@ -83,14 +83,17 @@ namespace Yavsc.Helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<JsonValue> InvokeJson(object query)
|
public async Task<JsonValue> InvokeJson(object query)
|
||||||
{
|
{
|
||||||
JsonValue jsonDoc=null;
|
JsonValue jsonDoc = null;
|
||||||
using (Stream streamQuery = request.GetRequestStream()) {
|
|
||||||
using (StreamWriter writer = new StreamWriter(streamQuery)) {
|
|
||||||
writer.Write (JsonConvert.SerializeObject(query));
|
|
||||||
}}
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
using (Stream streamQuery = request.GetRequestStream())
|
||||||
|
{
|
||||||
|
using (StreamWriter writer = new StreamWriter(streamQuery))
|
||||||
|
{
|
||||||
|
writer.Write(JsonConvert.SerializeObject(query));
|
||||||
|
}
|
||||||
|
}
|
||||||
using (WebResponse response = request.GetResponse())
|
using (WebResponse response = request.GetResponse())
|
||||||
{
|
{
|
||||||
using (Stream stream = response.GetResponseStream())
|
using (Stream stream = response.GetResponseStream())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue