Re: How to get to body of HTTP 500 error with std.net.curl.get()?

2020-02-16 Thread Anonymouse via Digitalmars-d-learn
On Sunday, 16 February 2020 at 09:13:54 UTC, ikod wrote: Just a note - this is not a bug, server really send empty body: < HTTP/1.1 500 Internal Server Error < cache-control: private < server: Microsoft-IIS/10.0 < x-aspnetmvc-version: 5.1 < access-control-allow-origin: * < x-aspnet-version: 4.0.

Re: How to get to body of HTTP 500 error with std.net.curl.get()?

2020-02-16 Thread ikod via Digitalmars-d-learn
On Saturday, 15 February 2020 at 20:38:51 UTC, Anonymouse wrote: On Saturday, 15 February 2020 at 16:25:42 UTC, Gregor Mückl When testing to confirm I ran into a bug[2] where the body is sometimes empty, but outside of fringe cases it should work. [1]: https://code.dlang.org/packages/request

Re: How to get to body of HTTP 500 error with std.net.curl.get()?

2020-02-15 Thread Boris Carvajal via Digitalmars-d-learn
On Friday, 14 February 2020 at 00:24:27 UTC, Gregor Mückl wrote: Hi! I am trying to write a client for pretty... well... creatively designed web API. The server gives HTTP status 500 replies if the requests are malformed, but the actual error message is hidden in the body of the reply (an XML

Re: How to get to body of HTTP 500 error with std.net.curl.get()?

2020-02-15 Thread Anonymouse via Digitalmars-d-learn
On Saturday, 15 February 2020 at 16:25:42 UTC, Gregor Mückl wrote: Unfortunately, this is not true. The msg only contains the text information in the status line of the HTTP reply. If I'm not mistaken, the exception is created in this line in std/net/curl.d: enforce(statusLine.code / 100

Re: How to get to body of HTTP 500 error with std.net.curl.get()?

2020-02-15 Thread Gregor Mückl via Digitalmars-d-learn
On Friday, 14 February 2020 at 13:23:01 UTC, Andre Pany wrote: On Friday, 14 February 2020 at 00:24:27 UTC, Gregor Mückl wrote: Hi! I am trying to write a client for pretty... well... creatively designed web API. The server gives HTTP status 500 replies if the requests are malformed, but the

Re: How to get to body of HTTP 500 error with std.net.curl.get()?

2020-02-14 Thread Andre Pany via Digitalmars-d-learn
On Friday, 14 February 2020 at 00:24:27 UTC, Gregor Mückl wrote: Hi! I am trying to write a client for pretty... well... creatively designed web API. The server gives HTTP status 500 replies if the requests are malformed, but the actual error message is hidden in the body of the reply (an XML

How to get to body of HTTP 500 error with std.net.curl.get()?

2020-02-13 Thread Gregor Mückl via Digitalmars-d-learn
Hi! I am trying to write a client for pretty... well... creatively designed web API. The server gives HTTP status 500 replies if the requests are malformed, but the actual error message is hidden in the body of the reply (an XML document!). std.net.curl.get() throws an exception in this case.