HTTPSocket.Post return 404 Page Not Found

Hi.

I’m making a simple POST request. That is url and form-data:

It worked fine in PostMan and Python. But in Xojo, response is 404 Page not found That is my code:

  Dim urlGetGroup As String = "https://api.appota.com/collection/get_group?access_token=6af5d59b24c75b952076b2e7c3583909052f33e75&lang=en"
  
  Dim formData As new Dictionary
  formData.Value("store") = "android"
  formData.Value("client") = "kulsbox"
  
  RequestDataHandler.SetFormData(formData)
  RequestDataHandler.Post(urlGetGroup)

Could anyone explain why it happened? Thanks

Anyone know this issue? I wasted a long time but no result.

In Chrome using either URL, I get

{"status":false,"error_code":1,"message":"Some of parametters are invalid!"}

At first glance, your code is OK. You may want to try the URL in a browser first to make sure it returns whatever the API is supposed to return.

I get a 200 response

{“status”:true,“error_code”:0,“message”:“Successfully!”,“data”:{“total”:2,“data”:[{“collection_id”:“177”,“name”:“My Group”,“type”:“group”,“cover”:"\/uploads\/collection_covers\/group\/5.png",“description”:“Qu\u00e1 hay”,“order”:“0”,“total_download”:“0”,“url”:""},{“collection_id”:“178”,“name”:“Game \u0111\u1ec9nh 2013”,“type”:“group”,“cover”:“http:\/\/static.appstore.vn\/a\/\/uploads\/collection_covers\/group\/6.png”,“description”:"",“order”:“2”,“total_download”:“85903”,“url”:""}]}}

My code in the window open event is

[code] mySocket = New classmySocket
mySocket.Secure = True
mySocket.ConnectionType = 1

Dim urlGetGroup As String = “https://api.appota.com/collection/get_group?access_token=6af5d59b24c75b952076b2e7c3583909052f33e75&lang=en

Dim formData As new Dictionary
formData.Value(“store”) = “android”
formData.Value(“client”) = “kulsbox”

mySocket.SetFormData(formData)
mySocket.Post(urlGetGroup)[/code]

where classmysocket is a HTTPSecureSocket & is a property of the window.

@Wayne Golding : Many thanks. When I try with HTTPSecureSocke, it return 200 response. But I still can not understand why I get 404 with HTTPSocket :smiley:
@Michel Bujardet : That is a POST request. Opening the url with Chrome is not a right way.

The URL is https://. HTTPSocket will post to an http://, which is in another part of the server.

Thanks. I’m clear now :smiley:

When the error is 404 not found a browser is a quick and easy way to check to see.