When my endpoint has an ending slash, e.g. "api/", the Apache access file shows '"POST /api/user/register HTTP/1.1" 404' and livehttpheaders are:
POST /api/user/register HTTP/1.1
Accept: application/json, multipart/form-data
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
Content-Type: application/json

When it doesn't have an ending slash, e.g. "api", the Apache access file shows '"POST /api/user/register HTTP/1.1" 406' and livehttpheaders are:
POST /rest/user/register HTTP/1.1
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
Content-Type: application/x-www-form-urlencoded

Service and Rest Server modules are enabled. The latest stable versions for Drupal 7. The user Resource is checked along with all of it's crud operations. All Caches cleared.
I even tried setting the weight of the two modules below 0 to run first. No luck.

CORS configuration: "api/| * * POST|Origin,X-Requested-With,Content-Type,Accept"

Enabled:
application/json
application/x-www-form-urlencoded
multipart/form-data

I've been at this for two days, and have reached desperation point. Any suggestions?

Comments

work77’s picture

Anyone?

work77’s picture

k. Nevermind.

Michael Dajewski’s picture

@work77 How did you resolve the issue?
I do have exactly the same issue on my local env.

kylebrowning’s picture

Why are you adding the trailing slash?

Remove that from your URL.

kylebrowning’s picture

Status: Active » Closed (fixed)