Hello I am trying to use this API with two different ways and I am not getting the same asnwer : With Javascript : The result I get here is : Which is the expected result… With PHP : The result I get here is : Which is not the expected one.. This problem happens in PHP when I try
Tag: http-headers
Sending Link Headers for Early Hints in PHP
Cloudflare has introduced Early Hints based on Link Header. I am a little bit confused about how I should send the link header in my PHP script. As I understand, I should send the Link Header for the links to preconnect I think we can send HTTP 103 Early Hint via PHP headers Is it enough? Answer No, you actually
PayPal IPN error: line folding of header fields is not supported
A PayPal IPN script that’s been running for years suddenly stopped working. PayPal is returning the following response: To summarize how PayPal IPN is supposed to work: PayPal POSTs to an endpoint on your system The endpoint must reply back to PayPal with the POST data it received PayPal responds back with VERIFIED In my case, PayPal cannot verify the
Setting Security Headers and Cookie Attributes for web server in Apache or PHP?
I know there are ways to set Security Headers and Cookie Attributes in PHP, but also in the Apache Virtualhost Config, for example: or: But I could also do this in PHP instead, for each cookie / header in every php file. Is there a reason to prefer one of the options above another? Doing it in Apache seems to
Retrieve data from CURL “-d” using PHP
This question is not about how to use CURL in PHP. But how to retrieve data that send using CURL with “-d” option. This command: curl -H ‘Content-Type: text/plain; charset=utf-8’ -d ‘Hello, World!’ -X POST http://localhost:8080 will produce empty array in $_POST variable. Does anyone know? Thank you. Answer I think this is a header conflict. You trying to send
PHP file download not recognizing file type in Chrome and Edge
I’m trying to create a simple download page, which currently works in Firefox but not entirely in Chrome and Edge. The file to download is an mp3, located in a private directory on the server. When I download the file in Firefox it works as intended. If I download it using Chrome or Edge the file still downloads, but it
Why am I receiving an HTTP 412 status error in React Native on subsequent downloads of a specific file?
I have created a React Native App that allows me to download Zip packages to my app. In most cases it has worked, I can download the zip package, delete a zip package, and re-download it again. …
how to force space to %20 in http_build_query?
I am facing a problem, that the API endpoint expects one of parameters with %20 replacing one of the spaces. Example: If I write ‘scope’ => ‘api offline_access’ the space gets translated to + sign when passing it to http_build_query() function. If I keep it like it is above, the sign is “wrapped” with more signs I tried to find
How return http_code 401 with PHP
I’m using cUrl in the client side. On my webservice (ws.php), i’ve this simple code : When i call this ws.php page, i still have http_code = 200. Here is my cUrl code is client side : $code = 200 even i put the header code “401”. Answer try this on your ws.php: Let me know if this works or
How to pass custom header to RESTful call?
There are some web service APIs that I need to connect to for my website. Most of the APIs involve something like this: But one web service requires the API key to be set in a custom HTTP header. How do I make the request to this API url and pass the custom header at the same time? Answer You