Title: fb_connect returning empty response
Last modified: August 24, 2016

---

# fb_connect returning empty response

 *  Resolved [bachmakm](https://wordpress.org/support/users/bachmakm/)
 * (@bachmakm)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/fb_connect-returning-empty-response/)
 * When I use the `fb_connect` method of the API to register a user via facebook,
   a response with status 200 is returned, but the response body is _completely_
   empty. There is no error message, no success message, just a null response.
 * My Request Headers are as follows (where **[omitted]…** indicates that I’ve shortened/
   removed the value):
 *     ```
       GET /api/user/fb_connect/?access_token=CAAV2hZCaUgyYBANkY[omitted]... HTTP/1.1
       Host: www.myhost.com
       Connection: close
       User-Agent: Paw/2.1.1 (Macintosh; OS X/10.10.2) GCDHTTPRequest
       ```
   
 * The response I receive looks like:
 *     ```
       HTTP/1.1 200 OK
       Date: Thu, 09 Apr 2015 17:47:58 GMT
       Server: Apache/2.4.7 (Ubuntu)
       X-Powered-By: PHP/5.5.9-1ubuntu4.6
       Set-Cookie: PHPSESSID=kba...[omitted]...ad6; path=/
       Expires: Thu, 19 Nov 1981 08:52:00 GMT
       Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
       Pragma: no-cache
       X-Pingback: http://www.myhost.com/xmlrpc.php
       Content-Length: 0
       Connection: close
       Content-Type: text/html; charset=UTF-8
       ```
   
 * I’ve followed the steps as listed [here](https://wordpress.org/plugins/json-api-user/other_notes/),
   including setting the email permission and approving app access, however I still
   receive an empty response. Is there something on the server side that I need 
   to configure before using `fb_connect`? Any help is greatly appreciated.
 * Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [bachmakm](https://wordpress.org/support/users/bachmakm/)
 * (@bachmakm)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/fb_connect-returning-empty-response/#post-5997954)
 * In addition, I’ve tested my access_token using the facebook graph `/me` REST 
   endpoint and the response is fine.
 * So `https://graph.facebook.com/me/?fields=id,first_name,last_name,email&access_token
   =CAAV2hZCaUgyYBANkY...` returns a JSON object containing all of the specified
   fields with the correct values.
 *  Plugin Author [Ali Qureshi](https://wordpress.org/support/users/parorrey/)
 * (@parorrey)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/fb_connect-returning-empty-response/#post-5998055)
 * Hi,
 * I tested with a valid access token and it worked just fine..
    try here: [https://developers.facebook.com/tools/explorer/](https://developers.facebook.com/tools/explorer/)
 * Make sure when you get access token for any fb app selected from top drop down,
   you do it with extended permissions and select email field.
 * Also, when email is missing, it prints out this response..
 * `{"status":"ok","msg":"Your 'access_token' did not return email of the user. 
   Without 'email' user can't be logged in or registered. Get user email extended
   permission while joining the Facebook app."}`
 *  Thread Starter [bachmakm](https://wordpress.org/support/users/bachmakm/)
 * (@bachmakm)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/fb_connect-returning-empty-response/#post-5998146)
 * Hey Ali,
 * Thanks for responding so quickly and for verifying that the service was working
   on your end. The issue was that my server did not have the PHP cURL library installed.
   The `fb_connect` method was failing/exiting at the point of curl initialization
   and therefore was returning an empty 200 response. Once the cURL library was 
   installed, this fixed the issue.
 * As part of a future release, it may be beneficial to return an error in the event
   that cURL is not installed or refactor to make use of the [WordPress HTTP API](http://codex.wordpress.org/HTTP_API)
   in lieu of cURL.
 * Thanks again for the help!
 *  Plugin Author [Ali Qureshi](https://wordpress.org/support/users/parorrey/)
 * (@parorrey)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/fb_connect-returning-empty-response/#post-5998149)
 * thanks for reporting the actual issue.. I will also switch to WordPress HTTP 
   API in next versions.
 * Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘fb_connect returning empty response’ is closed to new replies.

 * ![](https://ps.w.org/json-api-user/assets/icon-256x256.png?rev=1965790)
 * [JSON API User](https://wordpress.org/plugins/json-api-user/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-api-user/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-api-user/)
 * [Active Topics](https://wordpress.org/support/plugin/json-api-user/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-api-user/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-api-user/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Ali Qureshi](https://wordpress.org/support/users/parorrey/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/fb_connect-returning-empty-response/#post-5998149)
 * Status: resolved