Closed otapi closed 5 years ago
Does it work as below? It should because index.php is the default document.
dynamic client = new RestClient("http://en.directupload.net");
var result = client.Query(new
{
param = "stuff"
}).Get().Result
Let me know how you get on and if you need anything else.
No, the server what I need to reach doesn't use the default index.php, it uses a different name (getitem.php).
Sorry I misunderstood for resources that would result in invalid C# syntax use the Resource
method.
dynamic restClient = new RestClient("https://myserver.com/");
var result = await restClient.Resource("getitem.php").Query( new { param = "stuff" } ).Get();
I've re-tested this just in case of a bug, but it works correctly and calls https://myserver.com/getitem.php?param=stuff
https://restclient.dalsoft.io/docs/how-to-access-resources/ Has more information.
This works, thank you!
I need to reach a server via .php address - like on the RestClientTest example e.g.: http://en.directupload.net/index.php.
Simplify the example a bit:
The problem is that the constructed RequestUri has an unnecessary slash after the .php, like this:
http://en.directupload.net/index.php/?param=stuff
Therefore the PHP server doesn't understand the query :( How can remove that extra slash?