POST /projects/123/star.json returning 400 Bad Request - basecamp

Brought over from Git
Trying to add the new API URLs to the PHP Basecamp Client. Get stars and delete stars works fine, but POSTing throws a 400.
Request
POST /1804401/api/v1/projects/234118/star.json HTTP/1.1
Response
400 BAD REQUEST
Looks like it will work if I send the project_id as an argument in the payload.
Request
POST /1804401/api/v1/projects/234118/star.json HTTP/1.1
Request Body
{"project_id":234118}
Response
HTTP/1.1 201 Created

I checked our logs and I see your requests going through successfully. Could you try your POST again, with an empty request body?
Update: Aha! I see your requests receiving a 400 response - it's happening before they hit Basecamp. That could be due to a malformed request of some kind. Could you try to reproduce using curl so we can troubleshoot exactly what's occurring? Hard to tell from URL alone.

Related

Twilio Studio Flow HTTP Request Failed with Status code 500

I am working with Twilio Flow to create a WhatsApp Chat bot.
This bot allows user to start chat and respond with specific terms or numbers to proceed. It works fine, now I have added "Make HTTP Request" WIDGET to call an URL for posting the data received in response to DB.
When the HTTP Request is made, it returns FAIL & SUCCESS for some reasons,
On checking logs, i found out that a URL when any parameter is without any space or any special character, HTTP request gets success with Response code 200, but when its more than a word with added space or any special character HTTP request is failed and returned with Response code 500.
HTTP Request URL :
https://websiteurl.com/page.php?whatsapp_number={{contact.channel.address}}&message={{widgets.ReplyReceived5.inbound.Body}}
I also tried to make HTTP Request to https://webhook.site, but it also failed.
Added SUCCESS and FAILED Request Screenshot below.
Any help to fix this?
Image of HTTP Request getting SUCCESS with response code 200, Message parameter in URL without any space or special character
Image of HTTP Request FAILED with response code 500, Message parameter in URL with space
Twilio developer evangelist here.
In Studio, you can use HTTP Params and GET which will do the encoding (to handle spaces) for you. Or, you could use Liquid Filtering like {{ widgets.boop.di.doop | url_encode }}. My amazing coworker and Studio wizard Craig Dennis recommends using HTTP params.
Let me know if this helps at all!

Attempting to get X-RequestDigest from _api/contextinfo returns 403

When I try to POST to SharePoint REST API to the url/_web/contextinfo with POSTMAN I get status code of 200 and a new X-RequestDigest
But when I do the same in code bellow, I get status code of 403.
I think I'm missing something that is making a secure http request to sharepoint.
Thank you for your further help.
Image

grcp request payload format

I'm trying to log in into a site which requires grcp content-type using requests. I alrady have a HTTP 2 client, but I don't know how body of my post request should look like.
When I'm trying to simply copy request as a curl from chrome network tab, request body looks like this:
%äEMAIL"PASSWORD(0
When I'm trying to request site with same body as I copied from chrome tab, I'mm getting response with this headers:
Grpc-Message: grpc: received message larger than max (218767392 vs. 4194304)
Grpc-Status: 8
I'm sure It's becouse wrong payload format
If anybody knows how can I pass data in request plase help.
If you're trying to send a one-off gRPC request, https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md would be helpful to know as to how to construct a message. Otherwise, using gRPC clients (https://github.com/grpc/grpc) would make more sense.

REST API GET request - python gives HTTP 404, curl gives HTTP 200

I'm accessing a REST API to fetch some data using python (request module/python3.6) and for some resources it gives HTTP 404 error, and if i use the same URL using curl it gives the response with 200.
I have checked the following.
1) Response body size is not larger for those responses
2) there are no redirects, or permanent redirects. (no cross origin resource sharing)
what can cause this issue. Appreciate your suggestions.

Backbone/Node CORS : Options 200 OK, POST not working (Access-Control-Allow-Origin)

I'm facing the current problem which seems pretty strange to me. I'm using backbone on the front to handle my app and Node/Express on the back.
The OPTIONS request results in an 200 OK (I added a middleware on my node to allow CORS request) but the POST request ain't firing. Also the OPTIONS is 200 but it's still raising me an error in my console...
I've taken some screenshots :
Options Request:
Post Request:
Errors in the console
THanks by advance!
Access-Control-Allow-Origin authorizes for http://localhost while the request is to http://localhost:5000
You need to allow for that too.

Resources