I am enjoying a comfortable service with service service framework. Now I want to get raw bytes. Let's say that the URL is
It seems that the method is being used but I have used the post method.
Edit: I used the code I received raw bytes. However, compared with the method, about 200 bytes have been lost. Using the RestSharp method, the code is: Displays how raw bytes you can use: or as a stream: You do not have to use Type client to get raw bytes, you can easily use it: < / P>
`var x =" http: // xx. Xxx Xxx.xx / Myservice / api / hello ".PostJsonToUrl (New MyRequestDTO () {RequestData = hello}). ToArray ();
var aResponse = restClient.Execute (MyRequestDTO); Byte [] bytes = a response. Robates;
byte [] feedbackbites = clients. Get & lt; Byte [] & gt; ("/ Poco / world"); Var DTO = Responses. FruitUtF 8 Bits () By jonathan & lt; Pococortes & gt; (); Dto.Result // hello, world
using
(stream responseflow = client.get & lt; Stream & gt; ("/ poco / world")) {var dto = responsestream.ReadFully () .Utf8Bytes () Jason & lt; PocoResponse & gt; (); Dto.Result // Hello, World}
byte [] Raw Bows = "http://example.org/Myservice/api/hello" .GetBytesFromUrl ();
How to recover a byte by posting JSON and using HTTP utility extensions
var dtoBytes = new MyRequestDTO {...}. ToJson (). ToUtf8Bytes (); Var responsebits = "http://example.org/Myservice/api/hello". PostBytes TUURL (DTOBET, Content Type: "App / JS");
No comments:
Post a Comment