These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

411 Length Required

First post
Author
Mule hauler
State War Academy
Caldari State
#1 - 2015-05-16 12:43:05 UTC  |  Edited by: Mule hauler
I'm building a web application for personal use to grab some authenticated CREST stuff to work with.

I'm getting this error and it has been causing me to pull too many hairs (in fact, I'm almost bald):

411 Length Required

nginx/1.2.0


I figured out how to go through the authentication flow for OAuth using Postman and pulled a refresh token for my character.

The code I'm using is as follows (it is dirty but it does work):

http://pastebin.com/wNyt0srQ

I can get an access token using my personal refresh token and then I use this in the next request to pull a simple thing like https://crest-tq.eveonline.com/regions/ and I get 411 Length Required from nginx... What am I missing here?
Kali Izia
GoomWaffe
#2 - 2015-05-16 20:36:53 UTC
You're POSTing without sending any data. Remove line 17 and it should be ok.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#3 - 2015-05-17 02:18:45 UTC  |  Edited by: Steve Ronuken
While it's a total side issue, I'd recommend looking at Guzzle for handling your http stuff.

http://docs.guzzlephp.org/en/latest/

It's mostly a wrapper on curl, but it makes things nicer to work with.


https://github.com/fuzzysteve/CrestLibrary may also be of interest.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Mule hauler
State War Academy
Caldari State
#4 - 2015-05-17 04:03:22 UTC
Kali Izia wrote:
You're POSTing without sending any data. Remove line 17 and it should be ok.


I LOVE YOU! I forgot that you don't need to POST after you have the Bearer token. It's just a GET. Took out the POST and it worked like a charm!