# Good Postman request don't work on my php website

**URL:** <https://community.postman.com/t/good-postman-request-dont-work-on-my-php-website/60383>\
**Category:** Help Hub\
**Tags:** newman-project\
**Created:** [April 26, 2024, 10:47am UTC](https://community.postman.com/t/good-postman-request-dont-work-on-my-php-website/60383 "2024-04-26T10:47:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liflowam](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/liflowam/32/28390_2.png) [@liflowam](https://community.postman.com/u/liflowam)\
**Post date:** [April 26, 2024, 10:47am UTC](https://community.postman.com/t/good-postman-request-dont-work-on-my-php-website/60383/1 "2024-04-26T10:47:06Z")

</div>

Good morning. On Postman, I created a query which returns me a result but the generated code (PHP-CURL) which seems correct to me does not return “false”  
Method POST  
Postman Config:  
Params =\> nothing  
Authorization =\> default (inherit auth …)  
Headers =\> content-type: application/json, data-type: jsonp  
Body =\> {  
“Username”: “user-name”,  
“Password”: “pass-word”  
}

Postman return:

```auto
{
    "access_token": "xxxxxxx",
    "token_type": "xxx",
    "expires_in": 10799,
    "userName": "user-name",
    "issued": "2024-04-26T08:58:24Z",
    "expires": "2024-04-26T11:58:24Z",
    "error": "",
    "error_description": ""
}

```

Postman code generate:

```auto
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://XXX/api',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "Username": "user-name",
    "Password": "pass-word"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'dataType: jsonp'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

But $response = false

For information, I work on a local server

Thans for your help

---

<div class="post-metadata">

**Author:** ![gbadebo-bello](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gbadebo-bello/32/12175_2.png) [@gbadebo-bello](https://community.postman.com/u/gbadebo-bello)\
**Post date:** [April 29, 2024, 11:57am UTC](https://community.postman.com/t/good-postman-request-dont-work-on-my-php-website/60383/2 "2024-04-29T11:57:37Z")

</div>

Hi @liflowam.

Welcome to the Postman Community. I don’t fully understand your question. It is worth noting that Postman generated code “might” not work right out of the box due to several reasons which can include missing params, or missing authorization/authentication in the request. The generated code is meant to give you a good head start with replicating that same request in a language if your choosing.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [May 29, 2024, 11:58am UTC](https://community.postman.com/t/good-postman-request-dont-work-on-my-php-website/60383/3 "2024-05-29T11:58:16Z")

</div>

Closed on May 29, 2024, 11:58am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
