wp-net / WordPressPCL

This is a portable library for consuimg the WordPress REST-API in (almost) any C# application
MIT License
337 stars 129 forks source link

Media Upload: No route was found matching the URL and request method #219

Closed Webreaper closed 4 years ago

Webreaper commented 4 years ago

Hi, I'm using the PCL to upload media, and have it working for one Wordpress site. However, for another site, on the same host, with exactly the same code, config, auth plugin, etc., I get:

No route was found matching the URL and request method

Any ideas how I might go about debugging this or figuring out what the problem might be?! Is there any sort of verbose logging that could be turned on (e.g., is there any way to wire this up to something like Serilog and see the actual requests etc?). It doesn't look like it from the code I've browsed, but wanted to check.

Things I've checked:

  1. I have the JWT REST API plugin installed, and can see all the endpoints when I browse to /wp-json on the domain
  2. I have the auth etc set up in the .htaccess
  3. I have the token and CORS enabled in the wp-config.php

I've followed the same steps for both sites, but can't for the life of me figure out why it works for one, but not the other! :)

Webreaper commented 4 years ago

Okay, so a bit of debugging, and I managed to figure this out... for some reason it worked for https://www.mydomain.com, but not for https://mydomain.com. No idea why. :)