You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't seem to get the PHP Content-Type header to display in any of the response examples. I've also noticed that it's not being displayed in the demo as well for ONLY the PHP language.
Those are request examples, not response examples.
The content type isn't included, because the Guzzle library, which the PHP examples use, automatically sets it based on the data you provide. For example, passing in json => [...] will set it to application/json.
The screenshot you shared is of a GET request, so there's no body content;there and hence no content-type, but if you check some other type, you'll see what I mean.
If you don't agree with this and will prefer to include your headers manually, you can override the language templates with yours. Can't get you the link rn, but it's described in the docs, under Advanced Customisation, I think.
Those are request examples, not response examples.
My bad, I did mean request examples..
The content type isn't included, because the Guzzle library, which the PHP examples use, automatically sets it based on the data you provide.
That's interesting, but wouldn't you think we'd still want to display the Content-Type to whoever is integrating the api? Especially for folks like me who wasn't aware that Guzzle did that behind the scenes and MOSTLY for any of those not using Guzzle. I was trying to display a Content-Type of "application/x-www-form-urlencoded" in this case. I don't know, just feel like it'd be more clear that way.
The screenshot you shared is of a GET request, so there's no body content;there and hence no content-type, but if you check some other type, you'll see what I mean.
Sorry, bad examples but there is also a POST request on that demo without the Content-Type header as well (even though it's not shown due to bullet #2 above).
If you don't agree with this and will prefer to include your headers manually, you can override the language templates with yours. Can't get you the link rn, but it's described in the docs, under Advanced Customisation, I think.
Thank you for pointing this out! This will have to be the route I take.
Thank you so very much for the quick response! Love the package!
I can't seem to get the PHP Content-Type header to display in any of the response examples. I've also noticed that it's not being displayed in the demo as well for ONLY the PHP language.
https://demo.scribe.knuckles.wtf/
For example it show's up in bash (and javascript, python, and ruby):
But not in php:
Thanks!
The text was updated successfully, but these errors were encountered: